diff --git a/src/gallium/state_trackers/clover/api/context.cpp b/src/gallium/state_trackers/clover/api/context.cpp index c8d6689..80afb6b 100644 --- a/src/gallium/state_trackers/clover/api/context.cpp +++ b/src/gallium/state_trackers/clover/api/context.cpp @@ -37,7 +37,7 @@ clCreateContext(const cl_context_properties *props, cl_uint num_devs, (!pfn_notify && user_data)) throw error(CL_INVALID_VALUE); - if (any_of(is_zero(), devs, devs + num_devs)) + if (any_of(is_zero, devs, devs + num_devs)) throw error(CL_INVALID_DEVICE); for (auto p : mprops) { diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp index 775f251..9e371fd 100644 --- a/src/gallium/state_trackers/clover/api/kernel.cpp +++ b/src/gallium/state_trackers/clover/api/kernel.cpp @@ -206,7 +206,7 @@ namespace { throw error(CL_INVALID_CONTEXT); if (bool(num_deps) != bool(deps) || - any_of(is_zero(), deps, deps + num_deps)) + any_of(is_zero, deps, deps + num_deps)) throw error(CL_INVALID_EVENT_WAIT_LIST); if (any_of([](std::unique_ptr &arg) { @@ -220,7 +220,7 @@ namespace { if (dims < 1 || dims > q->dev.max_block_size().size()) throw error(CL_INVALID_WORK_DIMENSION); - if (!grid_size || any_of(is_zero(), grid_size, grid_size + dims)) + if (!grid_size || any_of(is_zero, grid_size, grid_size + dims)) throw error(CL_INVALID_GLOBAL_WORK_SIZE); if (block_size) { diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index b167904..74de840 100644 --- a/src/gallium/state_trackers/clover/api/program.cpp +++ b/src/gallium/state_trackers/clover/api/program.cpp @@ -35,7 +35,7 @@ clCreateProgramWithSource(cl_context ctx, cl_uint count, throw error(CL_INVALID_CONTEXT); if (!count || !strings || - any_of(is_zero(), strings, strings + count)) + any_of(is_zero, strings, strings + count)) throw error(CL_INVALID_VALUE); // Concatenate all the provided fragments together diff --git a/src/gallium/state_trackers/clover/api/transfer.cpp b/src/gallium/state_trackers/clover/api/transfer.cpp index 8ea8f86..295d6c7 100644 --- a/src/gallium/state_trackers/clover/api/transfer.cpp +++ b/src/gallium/state_trackers/clover/api/transfer.cpp @@ -40,7 +40,7 @@ namespace { throw error(CL_INVALID_COMMAND_QUEUE); if (bool(num_deps) != bool(deps) || - any_of(is_zero(), deps, deps + num_deps)) + any_of(is_zero, deps, deps + num_deps)) throw error(CL_INVALID_EVENT_WAIT_LIST); if (any_of([&](const cl_event ev) { diff --git a/src/gallium/state_trackers/clover/core/base.hpp b/src/gallium/state_trackers/clover/core/base.hpp index 2a2e26a..f487f0f 100644 --- a/src/gallium/state_trackers/clover/core/base.hpp +++ b/src/gallium/state_trackers/clover/core/base.hpp @@ -273,11 +273,9 @@ namespace clover { } template - std::function - is_zero() { - return [](const T &x) { - return x == 0; - }; + bool + is_zero(T x) { + return x == 0; } }