diff options
| author | David Phillips <david@sighup.nz> | 2017-01-21 16:59:29 +1300 | 
|---|---|---|
| committer | David Phillips <david@sighup.nz> | 2017-01-21 16:59:29 +1300 | 
| commit | ff7e90e5db1c82cab7dc743dc2f8b7fd195754a5 (patch) | |
| tree | bd912a942eef8f97a00059a5fb0317f1703378b8 /fractal-gen.c | |
| parent | dcba68a5a967967d87a04be9165715fd49ffae3e (diff) | |
| download | fractal-gen-opencl-ff7e90e5db1c82cab7dc743dc2f8b7fd195754a5.tar.xz | |
Add early-days source files
Diffstat (limited to 'fractal-gen.c')
| -rw-r--r-- | fractal-gen.c | 31 | 
1 files changed, 31 insertions, 0 deletions
| diff --git a/fractal-gen.c b/fractal-gen.c new file mode 100644 index 0000000..117e2ca --- /dev/null +++ b/fractal-gen.c @@ -0,0 +1,31 @@ +#include <stdio.h> + +#include "trampoline.h" + +int main() { +	fprintf(stderr, "Building CL trampoline... "); +	if (tramp_init()) { +		fprintf(stderr, "Failed.\n"); +		return 1; +	} +	fprintf(stderr, "Done.\n"); + +	fprintf(stderr, "Loading kernel source from file... "); +	if (tramp_load_kernel("test.cl")) { +		fprintf(stderr, "Failed.\n"); +		return 1; +	} +	fprintf(stderr, "Loaded.\n"); + +	fprintf(stderr, "Compiling kernel source... "); +	if (tramp_compile_kernel()) { +		fprintf(stderr, "Failed:\n%s\n", tramp_get_build_log()); +		return 1; +	} +	fprintf(stderr, "Compiled.\n"); + +	fprintf(stderr, "Destroying CL trampoline... "); +	tramp_destroy(); +	fprintf(stderr, "Blown to smitherines.\n"); +	return 0; +} | 
