Commit e23e8af8 authored by Dominik Charousset's avatar Dominik Charousset

Fix build when with logging enabled

parent 2ba524c8
...@@ -70,7 +70,7 @@ class actor_facade<Ret(Args...)> : public abstract_actor { ...@@ -70,7 +70,7 @@ class actor_facade<Ret(Args...)> : public abstract_actor {
result_mapping map_result = result_mapping{}) { result_mapping map_result = result_mapping{}) {
if (global_dims.empty()) { if (global_dims.empty()) {
auto str = "OpenCL kernel needs at least 1 global dimension."; auto str = "OpenCL kernel needs at least 1 global dimension.";
CAF_LOGM_ERROR("caf::opencl::actor_facade", str); CAF_LOGF_ERROR(str);
throw std::runtime_error(str); throw std::runtime_error(str);
} }
auto check_vec = [&](const dim_vec& vec, const char* name) { auto check_vec = [&](const dim_vec& vec, const char* name) {
...@@ -78,7 +78,7 @@ class actor_facade<Ret(Args...)> : public abstract_actor { ...@@ -78,7 +78,7 @@ class actor_facade<Ret(Args...)> : public abstract_actor {
std::ostringstream oss; std::ostringstream oss;
oss << name << " vector is not empty, but " oss << name << " vector is not empty, but "
<< "its size differs from global dimensions vector's size"; << "its size differs from global dimensions vector's size";
CAF_LOGM_ERROR("caf::opencl::actor_facade", oss.str()); CAF_LOGF_ERROR(oss.str());
throw std::runtime_error(oss.str()); throw std::runtime_error(oss.str());
} }
}; };
......
...@@ -33,8 +33,7 @@ void throwcl(const char* fname, cl_int err) { ...@@ -33,8 +33,7 @@ void throwcl(const char* fname, cl_int err) {
} }
void pfn_notify(const char* errinfo, const void*, size_t, void*) { void pfn_notify(const char* errinfo, const void*, size_t, void*) {
CAF_LOGC_ERROR("caf::opencl::opencl_metainfo", "initialize", CAF_LOGF_ERROR("\n##### Error message via pfn_notify #####\n"
"\n##### Error message via pfn_notify #####\n"
<< errinfo << << errinfo <<
"\n########################################"); "\n########################################");
} }
......
...@@ -49,7 +49,7 @@ program program::create(const char* kernel_source, const char* options, ...@@ -49,7 +49,7 @@ program program::create(const char* kernel_source, const char* options,
oss << "Device id " << device_id oss << "Device id " << device_id
<< " is not a vaild device. Maximum id is: " << (devices.size() - 1) << " is not a vaild device. Maximum id is: " << (devices.size() - 1)
<< "."; << ".";
CAF_LOGM_ERROR("caf::opencl::program", oss.str()); CAF_LOGF_ERROR(oss.str());
throw runtime_error(oss.str()); throw runtime_error(oss.str());
} }
// create program object from kernel source // create program object from kernel source
......
...@@ -15,7 +15,6 @@ using namespace caf::opencl; ...@@ -15,7 +15,6 @@ using namespace caf::opencl;
namespace { namespace {
using ivec = std::vector<int>; using ivec = std::vector<int>;
using fvec = std::vector<float>;
constexpr size_t matrix_size = 4; constexpr size_t matrix_size = 4;
constexpr size_t array_size = 32; constexpr size_t array_size = 32;
...@@ -166,7 +165,6 @@ square_matrix<Size> make_iota_matrix() { ...@@ -166,7 +165,6 @@ square_matrix<Size> make_iota_matrix() {
return result; return result;
} }
template<size_t Size> template<size_t Size>
bool operator==(const square_matrix<Size>& lhs, bool operator==(const square_matrix<Size>& lhs,
const square_matrix<Size>& rhs) { const square_matrix<Size>& rhs) {
...@@ -298,6 +296,8 @@ void test_opencl() { ...@@ -298,6 +296,8 @@ void test_opencl() {
int main() { int main() {
CAF_TEST(test_opencl); CAF_TEST(test_opencl);
announce<ivec>("ivec");
matrix_type::announce();
test_opencl(); test_opencl();
await_all_actors_done(); await_all_actors_done();
shutdown(); shutdown();
......
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