Skip to content

Commit

Permalink
Fixed a problem when compiling ImagePipelinePlugin OpenCL kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
Dade916 committed Apr 5, 2018
1 parent 025eed2 commit 396dfa6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/slg/film/imagepipeline/imagepipeline.cpp
Expand Up @@ -41,10 +41,18 @@ cl::Program *ImagePipelinePlugin::CompileProgram(Film &film, const string &kerne
SLG_LOG("[" << name << "] Defined symbols: " << kernelsParameters);
SLG_LOG("[" << name << "] Compiling kernels ");

// ImagePipelinePlugin kernels are simple enough to be compiled without
// problems and the workaround required for NVIDIA OpenCL compiler can
// be avoided

const string forceInlineDirective =
"#define OPENCL_FORCE_NOT_INLINE\n"
"#define OPENCL_FORCE_INLINE\n";

bool cached;
cl::STRING_CLASS error;
cl::Program *program = film.kernelCache->Compile(oclContext, oclDevice,
kernelsParameters, kernelSource,
kernelsParameters, forceInlineDirective + kernelSource,
&cached, &error);
if (!program) {
SLG_LOG("[" << name << "] kernel compilation error" << endl << error);
Expand Down

0 comments on commit 396dfa6

Please sign in to comment.