diff --git a/examples/OpenCLVectorAdd/CMakeLists.txt b/examples/OpenCLVectorAdd/CMakeLists.txt index e5b0bfca..df19fdb5 100644 --- a/examples/OpenCLVectorAdd/CMakeLists.txt +++ b/examples/OpenCLVectorAdd/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(TracyClient STATIC ../../TracyClient.cpp target_include_directories(TracyClient PUBLIC ../../) target_compile_definitions(TracyClient PUBLIC TRACY_ENABLE=1) -target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient) +target_link_libraries(OpenCLVectorAdd PUBLIC OpenCL::OpenCL TracyClient dl pthread) diff --git a/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp b/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp index d499424f..851cdd93 100644 --- a/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp +++ b/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp @@ -139,13 +139,14 @@ int main() for (int i = 0; i < 10; ++i) { + int n_value = static_cast(N); ZoneScopedN("VectorAdd Kernel Launch"); TracyCLZoneC(tracyCLCtx, "VectorAdd Kernel", tracy::Color::Blue4); CL_ASSERT(clSetKernelArg(vectorAddKernel, 0, sizeof(cl_mem), &bufferC)); CL_ASSERT(clSetKernelArg(vectorAddKernel, 1, sizeof(cl_mem), &bufferA)); CL_ASSERT(clSetKernelArg(vectorAddKernel, 2, sizeof(cl_mem), &bufferB)); - CL_ASSERT(clSetKernelArg(vectorAddKernel, 3, sizeof(int), &static_cast(N))); + CL_ASSERT(clSetKernelArg(vectorAddKernel, 3, sizeof(int), &n_value)); cl_event vectorAddKernelEvent; CL_ASSERT(clEnqueueNDRangeKernel(commandQueue, vectorAddKernel, 1, nullptr, &N, nullptr, 0, nullptr, &vectorAddKernelEvent));