diff options
author | Thomas White <taw@physics.org> | 2018-06-26 11:53:44 +0200 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2018-06-26 14:07:42 +0200 |
commit | 946ee4bc4a0bc13a965d170ab959cfe7a2cf1b27 (patch) | |
tree | da7397b4df4346724115023c5ac04ed50358b37b /src/diffraction-gpu.c | |
parent | a604828f8a21399574a39d9b3ce38b116fd98ee6 (diff) |
Embed diffraction.cl and hdfsee.ui into executables
Having to install these causes problems, e.g. you can't run from build
directory nor run tests without installing.
For hdfsee.ui, the XML is now embedded in the code just as it is for
cell_explorer.
diffraction.cl is a bit too long and complicated for that. There are a
number of nasty ways to embed such files. This one seems to be the
overall least nasty, although it requires data/gen-resources to be run
whenever diffraction.cl is changed.
Diffstat (limited to 'src/diffraction-gpu.c')
-rw-r--r-- | src/diffraction-gpu.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/diffraction-gpu.c b/src/diffraction-gpu.c index ea50b3fa..b0ed52ea 100644 --- a/src/diffraction-gpu.c +++ b/src/diffraction-gpu.c @@ -51,6 +51,7 @@ #include "cl-utils.h" #include "pattern_sim.h" +#include "diffraction.cl.h" #define SINC_LUT_ELEMENTS (4096) @@ -530,8 +531,9 @@ struct gpu_context *setup_gpu(int no_sfac, } free(flags_ptr); - gctx->prog = load_program(DATADIR"/crystfel/diffraction.cl", gctx->ctx, - dev, &err, cflags, insert_stuff); + gctx->prog = load_program_from_string(data_diffraction_cl, + data_diffraction_cl_len, gctx->ctx, + dev, &err, cflags, insert_stuff); if ( err != CL_SUCCESS ) { free(gctx); return NULL; |