Linking a kernel to a PTX function

Marco A.

Can I use a PTX function contained in a PTX file as an external device function to link it to another .cu file which should call that function?

This is another question from CUDA - link kernels together where the function itself is not contained in a .cu file but I rather have a PTX function to be linked somehow.

Vitality

You can load the file containing PTX code in your own code from the filesystem by cuModuleLoad and cuModuleGetFunction as follows:

CUmodule module;
CUfunction function;

const char* module_file = "my_ptx_file.ptx";
const char* kernel_name = "my_kernel_name";

err = cuModuleLoad(&module, module_file);
err = cuModuleGetFunction(&function, module, kernel_name);

You can also pass the PTX code to the CUDA driver directly as a string, see Passing the PTX program to the CUDA driver directly.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Linking a 64 bit Kernel

From Dev

Linking kernel module with precompiled object

From Dev

Undefined reference to in os kernel linking

From Dev

Undefined reference to in os kernel linking

From Dev

Linking shared library in linux kernel

From Dev

HTML Javascript function linking

From Dev

Linking to Kernel32.lib in assembler

From Dev

Jump to Protected Mode not working after linking the kernel

From Dev

Linking Custom Library to Linux Kernel Module in the Makefile

From Dev

Is the umask function a kernel function?

From Dev

Is possible to linking a function with a different name

From Dev

Issue With Encryption Function Not Linking To Main

From Dev

Linking sidebarPanels in shiny for SelectizeInput function

From Dev

Vectorised kernel function in R

From Dev

Hillis & Steele: Kernel Function

From Dev

Vectorised kernel function in R

From Dev

Inefficient kernel function

From Dev

kernel module function call

From Dev

Function pointer (to other kernel) as kernel arg in CUDA

From Dev

Linux kernel: get function address for kernel driver

From Dev

Replacing a kernel function by using loadable kernel modules

From Dev

Linking error with friend function in template class

From Dev

appendTo still linking to original container function

From Dev

Linking library and undefined reference to function in JNI

From Dev

C: Linking error for function of same signature

From Dev

Linking error with friend function in template class

From Dev

AngularJS Updating attribute in directive linking function dynamically

From Dev

Warn about deprecated function during linking?

From Dev

GTest linking error: undefined reference to 'foo::function'

Related Related

HotTag

Archive