Skip to content

Commit

Permalink
Merge pull request #190 from clEsperanto/gpu-compile-options
Browse files Browse the repository at this point in the history
add JIT compile option for silencing compatibility warning and fit compilation to device
  • Loading branch information
StRigaud authored Oct 2, 2023
2 parents 2c9e685 + 45410ca commit 527e8ed
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions clic/src/cudabackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,9 @@ CUDABackend::buildKernel(const Device::Pointer & device,
std::to_string(res));
}

const std::string arch_comp = "-arch=compute_" + cuda_device->getArch();
const std::array<const char *, 1> options = { arch_comp.c_str() };
const std::string arch_comp = "--gpu-architecture=compute_" + cuda_device->getArch();
const std::string woff = "--disable-warnings";
const std::array<const char *, 2> options = { arch_comp.c_str(), woff.c_str() };
res = nvrtcCompileProgram(prog, options.size(), options.data());
if (res != NVRTC_SUCCESS)
{
Expand Down
2 changes: 1 addition & 1 deletion clic/src/openclbackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ OpenCLBackend::buildKernel(const Device::Pointer & device,
throw std::runtime_error("Error (ocl): Failed to create program from source with error code " +
std::to_string(err));
}
cl_int buildStatus = clBuildProgram(prog, 0, nullptr, nullptr, nullptr, nullptr);
cl_int buildStatus = clBuildProgram(prog, 1, &opencl_device->getCLDevice(), "-w", nullptr, nullptr);
if (buildStatus != CL_SUCCESS)
{
size_t len;
Expand Down
1 change: 0 additions & 1 deletion clic/src/opencldevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ OpenCLDevice::initialize() -> void
{
if (isInitialized())
{
// std::cerr << "OpenCL device already initialized" << std::endl;
return;
}
cl_int err = CL_SUCCESS;
Expand Down

0 comments on commit 527e8ed

Please sign in to comment.