struct Material { float *refractive_index; float *absorption_length; float *scattering_length; }; struct Surface { float *absorption; float *reflection_diffuse; float *reflection_specular; }; __device__ struct Material materials[100]; __device__ struct Surface surfaces[100]; extern "C" { __global__ void set_material(int material_index, float *refractive_index, float *absorption_length, float *scattering_length) { materials[material_index].refractive_index = refractive_index; materials[material_index].absorption_length = absorption_length; materials[material_index].scattering_length = scattering_length; } __global__ void set_surface(int surface_index, float *absorption, float *reflection_diffuse, float *reflection_specular) { surfaces[surface_index].absorption = absorption; surfaces[surface_index].reflection_diffuse = reflection_diffuse; surfaces[surface_index].reflection_specular = reflection_specular; } } // extern "c"