相关疑难解决方法(0)

CUDA写入常量存储器错误值

我有以下代码从主机变量复制到__constant__CUDA中的变量

int main(int argc, char **argv){

    int exit_code;

    if (argc < 4) {
        std::cout << "Usage: \n " << argv[0] << " <input> <output> <nColors>" << std::endl;
        return 1;
    }

    Color *h_input;
    int h_rows, h_cols;

    timer1.Start();
    exit_code = readText2RGB(argv[1], &h_input, &h_rows, &h_cols);
    timer1.Stop();
    std::cout << "Reading: " << timer1.Elapsed() << std::endl;

    if (exit_code != SUCCESS){
        std::cout << "Error trying to read file." << std::endl;
        return FAILURE;
    }

    CpuTimer timer1;
    GpuTimer timer2;
    float timeStep2 = 0, timeStep3 = 0; …
Run Code Online (Sandbox Code Playgroud)

cuda gpu-constant-memory

0
推荐指数
1
解决办法
935
查看次数

标签 统计

cuda ×1

gpu-constant-memory ×1