cudaMemcpyToSymbol using or not using string

前端 未结 2 829
离开以前
离开以前 2021-01-06 06:22

I was trying to copy a structure to constant memory in this way:

struct Foo {
    int a, b, c;
};

__constant__ Foo cData;

int main() {
    Foo hData = {1,          


        
2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-06 06:58

    As of CUDA 5, using a string for symbol names is no longer supported. This is covered in the CUDA 5 release notes here

    •The use of a character string to indicate a device symbol, which was possible with certain API functions, is no longer supported. Instead, the symbol should be used directly.

    One of the reasons for this has to do with enabling of a true device linker, which is new functionality in CUDA 5.

提交回复
热议问题