Quantcast
Channel: Intel® Software - OpenCL*
Viewing all articles
Browse latest Browse all 1182

How to specify source file when multiple files are used?

$
0
0

I have multiple physical files (.cl) which I distribute over devices. This distribution is not fixed (which is why I don't bother combining the separate files into a single file.

I am combining the files into a program with the traditional:

    // Read Files
    for (i = 0; i < NUM_FILES; i++) {
        fp = fopen(file[i], "r");
        fseek(fp, 0, SEEK_END);
        src_size[i] = ftell(fp);
        rewind(fp);
        src[i] = (char*)malloc(src_size[i]);
        fread(src[i], 1, src_size[i], fp);
        fclose(fp);
    }
    // Create Program
    program = clCreateProgramWithSource(context, NUM_FILES, (const char**)src, src_size, &err);

 

HOWEVER, to compile my program with the debugging option, I'm not sure how I can specify the same list of files? The -s option only seems to allow for ONE source file name:

// Build Program (for each device that will execute kernels from this program)
err = clBuildProgram(program, num_devices, devices, "-g -s \"???????\"', NULL, NULL);

How do I specify a list of files?

I know I can combine my source files into a single file, but logistically, that is not what I prefer.

 


Viewing all articles
Browse latest Browse all 1182

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>