Skip to content

Commit 4bc8a13

Browse files
committed
clLinkProgram and clCompileProgram unimplemented in POCL
1 parent 9db2e6d commit 4bc8a13

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

test/quirks.hpp

+16-2
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,24 @@ inline bool supports_image_samplers(const boost::compute::device &device)
5858
return true;
5959
}
6060

61-
// returns true if the device supports image samplers.
61+
// returns true if the device supports clSetMemObjectDestructorCallback
6262
inline bool supports_destructor_callback(const boost::compute::device &device)
6363
{
64-
// clSetMemObjectDestructorCallback is unimplemented in POCL
64+
// unimplemented in POCL
65+
return !is_pocl_device(device);
66+
}
67+
68+
// returns true if the device supports clCompileProgram
69+
inline bool supports_compile_program(const boost::compute::device &device)
70+
{
71+
// unimplemented in POCL
72+
return !is_pocl_device(device);
73+
}
74+
75+
// returns true if the device supports clLinkProgram
76+
inline bool supports_link_program(const boost::compute::device &device)
77+
{
78+
// unimplemented in POCL
6579
return !is_pocl_device(device);
6680
}
6781

test/test_program.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <boost/compute/program.hpp>
2222
#include <boost/compute/utility/source.hpp>
2323

24+
#include "quirks.hpp"
2425
#include "context_setup.hpp"
2526

2627
namespace compute = boost::compute;
@@ -142,6 +143,10 @@ BOOST_AUTO_TEST_CASE(compile_and_link)
142143
{
143144
REQUIRES_OPENCL_VERSION(1,2);
144145

146+
if(!supports_compile_program(device) || !supports_link_program(device)) {
147+
return;
148+
}
149+
145150
// create the library program
146151
const char library_source[] = BOOST_COMPUTE_STRINGIZE_SOURCE(
147152
// for some reason the apple opencl compilers complains if a prototype

0 commit comments

Comments
 (0)