function::user_string_n_nofault - Linux


Overview

Function user_string_n_nofault is a function for getting the n-th function parameter, without any fault protection. It requires the function to have a sufficient number of non-optional parameters.

Syntax

user_string_n_nofault(nvFunction, n)

The syntax for user_string_n_nofault function in C++ is:

uint64_t user_string_n_nofault(NV_FUNCTION func, int n);

The following code sample shows you how to use the user_string_n_nofault function:

auto config = ::NvOF::Config("Hello String");
config.EnableExecution();
auto func = config.CreateFunction("myFunction");

if (func)
    func.Attach([&config](::NvOF::LaunchContext& ctx) -> ::NvOF::Status {
        ::NvOF::UserString s{ctx, 0};

        printf("%s\n", s.GetData());
        return ::NvOF::Status::Success;
    });

Options/Flags

None.

Examples

None.

Common Issues

The function will crash the application if the function does not have enough parameters.

Integration

This function can be used with other functions to access function parameters.

Related Commands