aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2016-05-17 16:03:18 +0200
committerFrancisco Jerez <[email protected]>2016-07-11 20:34:35 -0700
commitc478db6c0a54307b0ec816e63e86deb04a130b9c (patch)
tree344d6f7c6f59f4e4b1ae4de7215f51656eeb4f7a /src/gallium/state_trackers
parent9c7cda27929364804b34424bf4568d767490316d (diff)
clover: Trivial cleanups for api/program.cpp.
Reviewed-by: Serge Martin <[email protected]> Tested-by: Jan Vesely <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index 2dc9ee74f87..18360990cc3 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -28,12 +28,12 @@
using namespace clover;
namespace {
- void validate_build_program_common(const program &prog, cl_uint num_devs,
- const cl_device_id *d_devs,
- void (*pfn_notify)(cl_program, void *),
- void *user_data) {
-
- if ((!pfn_notify && user_data))
+ void
+ validate_build_common(const program &prog, cl_uint num_devs,
+ const cl_device_id *d_devs,
+ void (*pfn_notify)(cl_program, void *),
+ void *user_data) {
+ if (!pfn_notify && user_data)
throw error(CL_INVALID_VALUE);
if (prog.kernel_ref_count())
@@ -179,7 +179,7 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs,
ref_vector<device>(prog.context().devices()));
auto opts = (p_opts ? p_opts : "");
- validate_build_program_common(prog, num_devs, d_devs, pfn_notify, user_data);
+ validate_build_common(prog, num_devs, d_devs, pfn_notify, user_data);
if (prog.has_source) {
prog.compile(devs, opts);
@@ -205,7 +205,7 @@ clCompileProgram(cl_program d_prog, cl_uint num_devs,
auto opts = (p_opts ? p_opts : "");
header_map headers;
- validate_build_program_common(prog, num_devs, d_devs, pfn_notify, user_data);
+ validate_build_common(prog, num_devs, d_devs, pfn_notify, user_data);
if (bool(num_headers) != bool(header_names))
throw error(CL_INVALID_VALUE);
@@ -213,7 +213,6 @@ clCompileProgram(cl_program d_prog, cl_uint num_devs,
if (!prog.has_source)
throw error(CL_INVALID_OPERATION);
-
for_each([&](const char *name, const program &header) {
if (!header.has_source)
throw error(CL_INVALID_OPERATION);