Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix: added missing return value assignment #426

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/gc/ExecutionEngine/GPURuntime/ocl/GpuOclRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,20 +218,20 @@ struct OclRuntime::Exports {
CL_CHECKR(err, "Failed to create OpenCL program with IL.");

gcLogD("Created new OpenCL program: ", program);
clBuildProgram(program, 1, &ctx->runtime.ext.device, nullptr, nullptr,
nullptr);
CL_CHECKR(err, "Failed to build the program: ", program);
gcLogD("The program has been built: ", program);
err = clBuildProgram(program, 1, &ctx->runtime.ext.device, nullptr, nullptr,
nullptr);

auto kernel = clCreateKernel(program, name, &err);
if (err != CL_SUCCESS) {
// This is a special case, handled by OclModuleBuilder::build(), that
// allows rebuilding the kernel with different options in case of failure.
clReleaseProgram(program);
gcLogD("OpenCL error ", err,
": Failed to create OpenCL kernel from program: ", program);
gcLogD("OpenCL error ", err, ": Failed to build the program: ", program);
return new Kernel(nullptr, nullptr, gridSize, blockSize, argNum, argSize);
}

gcLogD("The program has been built: ", program);
auto kernel = clCreateKernel(program, name, &err);
CL_CHECKR(err, "Failed to create OpenCL kernel from program: ", program);
gcLogD("Created new OpenCL kernel ", kernel, " from program ", program);

cl_bool enable = CL_TRUE;
Expand Down
Loading