9#pragma autolink -L$BASILISK/grid/gpu -lglfw -lgpu -ldl
34#define GL_C(stmt) do { stmt; } while (0)
37#define GL_C(stmt) do { \
39 gpu_check_error (#stmt, __FILE__, LINENO); \
132 fprintf (
stderr,
"GLSL: could not link shader \n\n%s\n%s\n%s\n",
207 printf (
"Maximal workgroup sizes:\n\tx:%u\n\ty:%u\n\tz:%u\n",
214 printf (
"Maximum number of local invocations:\n\tx:%u\n\ty:%u\n\tz:%u\n",
223# define tracing_foreach(name, file, line) tracing(name, file, line)
224# define end_tracing_foreach(name, file, line) end_tracing(name, file, line)
226# define tracing_foreach(name, file, line)
227# define end_tracing_foreach(name, file, line)
392 "%s:%d: error: cannot allocate %ld bytes\n"
393 "%s:%d: error: maximum allowed is %d x %ld bytes\n",
400 fprintf (
stderr,
"resizing from %ld to %ld nssbo %d pnssbo %d max_ssbo %ld\n",
470 for (
int _s = 0;
_s < 1;
_s++)
471 if (
s.gpu.stored > 0)
480#define realloc_scalar(size) realloc_scalar_gpu (size)
define double double char flags
void cartesian_boundary_level(scalar *list, int l)
define double double char Reduce reductions
define VT _attribute[s.i] v y scalar * list
scalar * list_prepend(scalar *list, scalar s)
static _Attributes * _attribute
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define func
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line line realloc(p, s) @ define pfree(p
#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS
#define GL_MAX_GEOMETRY_INPUT_COMPONENTS
#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS
#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS
#define GL_MAX_COMPUTE_UNIFORM_BLOCKS
#define GL_MAX_COMPUTE_WORK_GROUP_COUNT
#define GL_FRAGMENT_SHADER
#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS
#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS
#define GL_COPY_WRITE_BUFFER
#define glGetShaderInfoLog
#define GL_MAX_FRAGMENT_INPUT_COMPONENTS
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
#define GL_MAX_VERTEX_OUTPUT_COMPONENTS
#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS
#define GL_MAX_VERTEX_UNIFORM_BLOCKS
#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE
#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS
#define GL_SHADER_STORAGE_BUFFER
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS
#define GL_COMPUTE_SHADER
#define GL_MAX_COMPUTE_WORK_GROUP_SIZE
#define glBindFramebuffer
#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS
#define GL_MAX_TEXTURE_BUFFER_SIZE
#define GL_COMPILE_STATUS
#define GL_MAX_DRAW_BUFFERS
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS
#define GL_MAX_IMAGE_UNITS
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS
#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS
#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS
#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS
#define glGetProgramInfoLog
#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS
#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS
#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS
#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS
#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS
#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS
#define GL_INFO_LOG_LENGTH
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS
#define glCopyBufferSubData
#define GL_COPY_READ_BUFFER
macro2 foreach_coarse_level_stencil(int _level, char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
static char * getShaderLogInfo(GLuint shader)
static struct @7 GPUContext
GLString gpu_limits_list[]
void printWorkGroupsCapabilities()
bool gpu_end_stencil(ForeachData *loop, const RegionParameters *region, External *externals, const char *kernel)
char * gpu_errors(const char *errors, const char *source, char *fout)
#define end_tracing_foreach(name, file, line)
macro2 foreach_level_stencil(int _level, char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
end_tracing(func, file, line)
void gpu_free_solver(void)
void realloc_scalar_gpu(int size)
#define realloc_scalar(size)
macro2 foreach_point_stencil(double _xp, double _yp, double _zp, char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
#define tracing_foreach(name, file, line)
static char * getProgramLogInfo(GLuint program)
macro2 foreach_level_or_leaf_stencil(int _level, char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
static void gpu_check_error(const char *stmt, const char *fname, int line)
static GLuint createShaderFromString(const char *shaderSource, const GLenum shaderType)
macro2 foreach_stencil_generic(char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
macro2 foreach_stencil(char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
ifndef tracing def tracing(func, file, line) do
macro2 foreach_region_stencil(coord _p, coord _box[2], coord _n, char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
macro2 foreach_face_stencil(char flags, Reduce reductions, const char *_order, int _parallel, External *_externals, const char *_kernel)
static void gpu_cpu_sync_scalar(scalar s, char *sep, GLenum mode)
void gpu_boundary_level(scalar *list, int l)
static GLuint loadNormalShader(const char *vsSource, const char *fsShader)
macro2 foreach_vertex_stencil(char flags, Reduce reductions, int _parallel, External *_externals, const char *_kernel)
void check_stencil(ForeachData *loop)
This function is called after the stencil access detection, just before the (real) foreach loop is ex...