mmc_cl_host.h
1 /***************************************************************************/
32 /***************************************************************************/
38 #ifndef _MMC_HOSTCODE_CL_H
39 #define _MMC_HOSTCODE_CL_H
40 
41 #include "mmc_cl_utils.h"
42 #include "mmc_mesh.h"
43 #include "mmc_raytrace.h"
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #ifndef CL_MEM_LOCATION_HOST_NV
50 #define CL_MEM_LOCATION_HOST_NV (1 << 0)
51 typedef cl_bitfield cl_mem_flags_NV;
52 #endif
53 
54 #define RO_MEM (CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR)
55 #define WO_MEM (CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR)
56 #define RW_MEM (CL_MEM_READ_WRITE | CL_MEM_COPY_HOST_PTR)
57 #define RW_PTR (CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR)
58 #define NV_PIN CL_MEM_LOCATION_HOST_NV
59 
60 #define OCL_ASSERT(x) ocl_assess((x),__FILE__,__LINE__)
61 
62 #define RAND_SEED_WORD_LEN 4 //48 bit packed with 64bit length
63 
64 typedef struct PRE_ALIGN(32) GPU_mcconfig {
65  cl_float3 srcpos;
66  cl_float3 srcdir;
67  cl_float tstart, tend;
68  cl_uint isreflect, issavedet, issaveexit, ismomentum, isatomic, isspecular;
69  cl_float Rtstep;
70  cl_float minenergy;
71  cl_uint maxdetphoton;
72  cl_uint maxmedia;
73  cl_uint detnum;
74  cl_int voidtime;
75  cl_int srctype;
76  cl_float4 srcparam1;
77  cl_float4 srcparam2;
78  cl_uint issaveref;
79  cl_uint maxgate;
80  cl_uint debuglevel;
81  cl_int reclen;
82  cl_int outputtype;
83  cl_int elemlen;
84  cl_int mcmethod;
85  cl_int method;
86  cl_float dstep;
87  cl_float focus;
88  cl_int nn, ne, nf;
89  cl_float3 nmin;
90  cl_float nout;
91  cl_uint roulettesize;
92  cl_int srcnum;
93  cl_int4 crop0;
94  cl_int srcelemlen;
95  cl_float4 bary0;
96  cl_int e0;
97  cl_int isextdet;
98  cl_int framelen;
99  cl_uint nbuffer;
100  cl_uint maxpropdet;
101  cl_uint normbuf;
102  cl_int issaveseed;
103  cl_uint seed;
104 } MCXParam POST_ALIGN(32);
105 
106 typedef struct POST_ALIGN(32) GPU_reporter {
107  float raytet;
108 } MCXReporter POST_ALIGN(32);
109 
110 void mmc_run_cl(mcconfig* cfg, tetmesh* mesh, raytracer* tracer);
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif
This structure defines the problem settings (domain, filenames, session)
Definition: mmc_utils.h:184
Definition of the core ray-tracing functions.
const char outputtype[]
Definition: mmc_utils.c:161
Basic FEM mesh data structrure.
Definition: mmc_mesh.h:90
Definition of basic mesh data structures and inline vector operations.
Ray-tracer data structrure for pre-computed data.
Definition: mmc_mesh.h:128