diff options
Diffstat (limited to 'src/opencl_mesh_kit.cpp')
-rw-r--r-- | src/opencl_mesh_kit.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/opencl_mesh_kit.cpp b/src/opencl_mesh_kit.cpp index 6e41c25..318a928 100644 --- a/src/opencl_mesh_kit.cpp +++ b/src/opencl_mesh_kit.cpp @@ -131,9 +131,22 @@ cl_int OpenCLMeshKit::compileKernels(const char source[], size_t sourceLen) { return 21; } - res = clBuildProgram(program, 1, &cl_dev, "", NULL, NULL); + res = clBuildProgram(program, 1, &cl_dev, "-Werror", NULL, NULL); if ( res!=CL_SUCCESS ) { std::cerr << "Failed to clBuildProgram()" << std::endl; + + // Shows the log + char* build_log; + size_t log_size; + // First call to know the proper size + clGetProgramBuildInfo(program, cl_dev, CL_PROGRAM_BUILD_LOG, 0, NULL, &log_size); + build_log = new char[log_size+1]; + // Second call to get the log + clGetProgramBuildInfo(program, cl_dev, CL_PROGRAM_BUILD_LOG, log_size, build_log, NULL); + build_log[log_size] = '\0'; + std::cerr << build_log << std::endl; + delete[] build_log; + return 22; } @@ -241,7 +254,7 @@ cl_int OpenCLMeshKit::resetVBO() { cl_int res; std::map<std::string, cl_kernel> user_kernels=kernels; - res = compileKernels(kernel_src_zero_z, sizeof(kernel_src_zero_z)); + res = compileKernels(kernel_src_zero_z, sizeof(kernel_src_zero_z)-1); if(res==0) res = execKernel("zero_z", 0.0f); |