aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-02-18 00:48:16 +1300
committerDavid Phillips <david@sighup.nz>2017-02-18 00:48:16 +1300
commitd356d2bea1a5c0012bf6ef746a90f86b2076d9c2 (patch)
treeeee34f17d35394da91e0d15c5889540de7fec46e
parentea11f0c71f1617bbfdb5a5ef6644e34cb0192e29 (diff)
downloadfractal-gen-opencl-d356d2bea1a5c0012bf6ef746a90f86b2076d9c2.tar.xz
Add macro to set CL kernel source directory
This will future-proof the software for installation to system roots, where the executable isn't being run in the source tree.
-rw-r--r--cl/mandelbrot.cl (renamed from mandelbrot.cl)0
-rw-r--r--config.mk2
-rw-r--r--fractal-gen.c2
3 files changed, 2 insertions, 2 deletions
diff --git a/mandelbrot.cl b/cl/mandelbrot.cl
index 2652108..2652108 100644
--- a/mandelbrot.cl
+++ b/cl/mandelbrot.cl
diff --git a/config.mk b/config.mk
index 2c4b751..5b068e5 100644
--- a/config.mk
+++ b/config.mk
@@ -1,2 +1,2 @@
-CFLAGS += -I/usr/include/CL/
+CFLAGS += -I/usr/include/CL/ -DCL_SRC_DIR=\"./cl/\"
LDFLAGS += -lOpenCL
diff --git a/fractal-gen.c b/fractal-gen.c
index 91a2f18..60b27e3 100644
--- a/fractal-gen.c
+++ b/fractal-gen.c
@@ -14,7 +14,7 @@ int run(unsigned int size, unsigned int iterations)
fprintf(stderr, "Done.\n");
fprintf(stderr, "Loading kernel source from file... ");
- if (tramp_load_kernel("mandelbrot.cl")) {
+ if (tramp_load_kernel(CL_SRC_DIR"mandelbrot.cl")) {
fprintf(stderr, "Failed.\n");
return 1;
}