Commit cb8588c3 authored by Marian Triebe's avatar Marian Triebe

Fix build of OpenCL module under windows

closes #644
parent 463ebbfe
...@@ -572,6 +572,7 @@ if(NOT CAF_NO_OPENCL) ...@@ -572,6 +572,7 @@ if(NOT CAF_NO_OPENCL)
if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0) if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 3.0)
find_package(OpenCL) find_package(OpenCL)
if(OpenCL_FOUND) if(OpenCL_FOUND)
include_directories(BEFORE ${OpenCL_INCLUDE_DIRS})
add_optional_caf_lib(opencl) add_optional_caf_lib(opencl)
add_optional_caf_binaries(libcaf_opencl/examples) add_optional_caf_binaries(libcaf_opencl/examples)
else() else()
......
...@@ -33,7 +33,9 @@ if(NOT CAF_BUILD_STATIC_ONLY) ...@@ -33,7 +33,9 @@ if(NOT CAF_BUILD_STATIC_ONLY)
endif() endif()
# build static library only if --build-static or --build-static-only was set # build static library only if --build-static or --build-static-only was set
if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC) if(CAF_BUILD_STATIC_ONLY OR CAF_BUILD_STATIC)
add_library(libcaf_opencl_static STATIC ${LIBCAF_OPENCL_HDRS} ${LIBCAF_OPENCL_SRCS}) add_library(libcaf_opencl_static STATIC ${LIBCAF_OPENCL_SRCS}
${LIBCAF_OPENCL_HDRS}
${OpenCL_INCLUDE_DIRS})
target_link_libraries(libcaf_opencl_static ${LD_FLAGS} target_link_libraries(libcaf_opencl_static ${LD_FLAGS}
${CAF_LIBRARY_CORE_STATIC} ${CAF_LIBRARY_CORE_STATIC}
${OpenCL_LIBRARIES}) ${OpenCL_LIBRARIES})
......
...@@ -32,7 +32,7 @@ namespace caf { ...@@ -32,7 +32,7 @@ namespace caf {
namespace opencl { namespace opencl {
void throwcl(const char* fname, cl_int err); void throwcl(const char* fname, cl_int err);
void pfn_notify(const char* errinfo, const void*, size_t, void*); void CL_CALLBACK pfn_notify(const char* errinfo, const void*, size_t, void*);
// call convention for simply calling a function // call convention for simply calling a function
template <class F, class... Ts> template <class F, class... Ts>
......
...@@ -32,7 +32,7 @@ void throwcl(const char* fname, cl_int err) { ...@@ -32,7 +32,7 @@ void throwcl(const char* fname, cl_int err) {
} }
} }
void pfn_notify(const char* errinfo, const void*, size_t, void*) { void CL_CALLBACK pfn_notify(const char* errinfo, const void*, size_t, void*) {
CAF_LOG_ERROR("\n##### Error message via pfn_notify #####\n" CAF_LOG_ERROR("\n##### Error message via pfn_notify #####\n"
<< errinfo << << errinfo <<
"\n########################################"); "\n########################################");
......
...@@ -458,7 +458,7 @@ void test_opencl(actor_system& sys) { ...@@ -458,7 +458,7 @@ void test_opencl(actor_system& sys) {
return problem_size; return problem_size;
}; };
// constant memory arguments // constant memory arguments
const ivec arr7{problem_size}; const ivec arr7{static_cast<int>(problem_size)};
auto w7 = mngr.spawn(kernel_source, kn_const, auto w7 = mngr.spawn(kernel_source, kn_const,
opencl::nd_range{dims{problem_size}}, opencl::nd_range{dims{problem_size}},
opencl::in<int>{}, opencl::in<int>{},
...@@ -759,7 +759,7 @@ void test_in_val_out_val(actor_system& sys) { ...@@ -759,7 +759,7 @@ void test_in_val_out_val(actor_system& sys) {
// calculator function for getting the size of the output // calculator function for getting the size of the output
auto res_size2 = [](const ivec&) { return problem_size; }; auto res_size2 = [](const ivec&) { return problem_size; };
// constant memory arguments // constant memory arguments
const ivec input2{problem_size}; const ivec input2{static_cast<int>(problem_size)};
auto w6 = mngr.spawn(kernel_source, kn_const, auto w6 = mngr.spawn(kernel_source, kn_const,
nd_range{dims{problem_size}}, nd_range{dims{problem_size}},
in<int>{}, out<int>{res_size2}); in<int>{}, out<int>{res_size2});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment