In Situ Animation of Accelerated Computations
Go to the documentation of this file. 20 #define ISAAC_CUDA_CHECK(call) \ 22 const cudaError_t error = call; \ 23 if (error != cudaSuccess) \ 25 fprintf(stderr, "Error: %s:%d, ", __FILE__, __LINE__); \ 26 fprintf(stderr, "code: %d, reason: %s\n", error, \ 27 cudaGetErrorString(error)); \ 31 #define ISAAC_FOR_EACH_DIM_4(start,end) \ 37 #define ISAAC_FOR_EACH_DIM_3(start,end) \ 42 #define ISAAC_FOR_EACH_DIM_2(start,end) \ 46 #define ISAAC_FOR_EACH_DIM_1(start,end) \ 49 #define ISAAC_FOR_EACH_DIM(dim,start,end) \ 50 BOOST_PP_CAT( ISAAC_FOR_EACH_DIM_, dim) (start,end) 52 #define ISAAC_FOR_EACH_DIM_TWICE_4(start,middle,end) \ 53 start.x middle.x end \ 54 start.y middle.y end \ 55 start.z middle.z end \ 58 #define ISAAC_FOR_EACH_DIM_TWICE_3(start,middle,end) \ 59 start.x middle.x end \ 60 start.y middle.y end \ 63 #define ISAAC_FOR_EACH_DIM_TWICE_2(start,middle,end) \ 64 start.x middle.x end \ 67 #define ISAAC_FOR_EACH_DIM_TWICE_1(start,middle,end) \ 70 #define ISAAC_FOR_EACH_DIM_TWICE(dim,start,middle,end) \ 71 BOOST_PP_CAT( ISAAC_FOR_EACH_DIM_TWICE_, dim) (start,middle,end) 73 #define ISAAC_SWITCH_IF_SMALLER(left,right) \ 81 #define ISAAC_SET_COLOR( dest, color ) \ 84 result.x = ISAAC_MIN( isaac_uint( ISAAC_MIN( isaac_float(1), color.x ) * 255.0f ), 255u); \ 85 result.y = ISAAC_MIN( isaac_uint( ISAAC_MIN( isaac_float(1), color.y ) * 255.0f ), 255u); \ 86 result.z = ISAAC_MIN( isaac_uint( ISAAC_MIN( isaac_float(1), color.z ) * 255.0f ), 255u); \ 87 result.w = ISAAC_MIN( isaac_uint( ISAAC_MIN( isaac_float(1), color.w ) * 255.0f ), 255u); \ 88 dest = (result.w << 24) | (result.z << 16) | (result.y << 8) | (result.x << 0); \ 91 #define ISAAC_START_TIME_MEASUREMENT( unique_name, time_function ) \ 92 uint64_t BOOST_PP_CAT( __tm_start_, unique_name ) = time_function; 93 #define ISAAC_STOP_TIME_MEASUREMENT( result, operand, unique_name, time_function ) \ 94 result operand time_function - BOOST_PP_CAT( __tm_start_, unique_name ); 96 #define ISAAC_SET_IDENTITY(size,matrix) \ 97 for (isaac_int x = 0; x < size; x++) \ 98 for (isaac_int y = 0; y < size; y++) \ 99 (matrix)[x+y*size] = (x==y)?1.0f:0.0f; 101 #define ISAAC_JSON_ADD_MATRIX(array,matrix,count) \ 102 for (isaac_int i = 0; i < count; i++) \ 103 json_array_append_new( array, json_real( (matrix)[i] ) ); 105 #ifdef ISAAC_THREADING 106 #define ISAAC_WAIT_VISUALIZATION \ 107 if (visualizationThread) \ 109 pthread_join(visualizationThread,NULL); \ 110 visualizationThread = 0; \ 113 #define ISAAC_WAIT_VISUALIZATION {} 116 #define ISAAC_HANDLE_EPIPE(add,n,sockfd,readThread) \ 119 pthread_join(readThread,NULL); \