Halide
HalideRuntimeOpenGLCompute.h
Go to the documentation of this file.
1 #ifndef HALIDE_HALIDERUNTIMEOPENGLCOMPUTE_H
2 #define HALIDE_HALIDERUNTIMEOPENGLCOMPUTE_H
3 
4 // Don't include HalideRuntime.h if the contents of it were already pasted into a generated header above this one
5 #ifndef HALIDE_HALIDERUNTIME_H
6 
7 #include "HalideRuntime.h"
8 
9 #endif
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /** \file
16  * Routines specific to the Halide OpenGL Compute runtime.
17  */
18 
19 #define HALIDE_RUNTIME_OPENGLCOMPUTE
20 
21 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
23 
24 /** These are forward declared here to allow clients to override the
25  * Halide Glsl runtime. Do not call them. */
26 // @{
27 
28 /** This function sets up OpenGL context, loads relevant GL functions, then
29  * compiles src OpenGL compute shader into OpenGL program and stores it for future use.
30  */
31 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
32 extern int halide_openglcompute_initialize_kernels(void *user_context, void **state_ptr,
33  const char *src, int size);
34 
35 /** This function triggers execution of OpenGL program built around compute shader.
36  * Execution of the shader is parallelized into given number of blocks and threads.
37  *
38  * This function doesn't wait for the completion of the shader, but it sets memory
39  * barrier which forces successive retrieval of output data to wait until shader is done.
40  */
41 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
42 extern int halide_openglcompute_run(void *user_context,
43  void *state_ptr,
44  const char *entry_name,
45  int blocksX, int blocksY, int blocksZ,
46  int threadsX, int threadsY, int threadsZ,
47  int shared_mem_bytes,
48  struct halide_type_t arg_types[],
49  void *args[],
50  int8_t is_buffer[]);
51 
52 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
53 extern void halide_openglcompute_finalize_kernels(void *user_context, void *state_ptr);
54 // @}
55 
56 /** This function retrieves pointers to OpenGL API functions.
57  *
58  * You may have to implement this yourself. Halide only provides implementations
59  * for some platforms."
60  */
61 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
62 extern void *halide_opengl_get_proc_address(void *user_context, const char *name);
63 
64 /** This function creates an OpenGL context for use by the OpenGL backend.
65  *
66  * You may have to implement this yourself as well. Halide only provides
67  * implementations for some platforms."
68  */
69 HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
70 extern int halide_opengl_create_context(void *user_context);
71 
72 #ifdef __cplusplus
73 } // End extern "C"
74 #endif
75 
76 #endif // HALIDE_HALIDERUNTIMEOPENGLCOMPUTE_H
halide_openglcompute_device_interface
const struct halide_device_interface_t * halide_openglcompute_device_interface()
halide_openglcompute_initialize_kernels
int halide_openglcompute_initialize_kernels(void *user_context, void **state_ptr, const char *src, int size)
These are forward declared here to allow clients to override the Halide Glsl runtime.
int8_t
signed __INT8_TYPE__ int8_t
Definition: runtime_internal.h:28
halide_type_t
A runtime tag for a type in the halide type system.
Definition: HalideRuntime.h:476
Halide
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
Definition: AbstractGenerator.h:19
halide_openglcompute_finalize_kernels
void halide_openglcompute_finalize_kernels(void *user_context, void *state_ptr)
HALIDE_ATTRIBUTE_DEPRECATED
#define HALIDE_ATTRIBUTE_DEPRECATED(x)
Definition: HalideRuntime.h:1649
halide_opengl_get_proc_address
void * halide_opengl_get_proc_address(void *user_context, const char *name)
This function retrieves pointers to OpenGL API functions.
HalideRuntime.h
halide_opengl_create_context
int halide_opengl_create_context(void *user_context)
This function creates an OpenGL context for use by the OpenGL backend.
halide_device_interface_t
Each GPU API provides a halide_device_interface_t struct pointing to the code that manages device all...
Definition: HalideRuntime.h:770
halide_openglcompute_run
int halide_openglcompute_run(void *user_context, void *state_ptr, const char *entry_name, int blocksX, int blocksY, int blocksZ, int threadsX, int threadsY, int threadsZ, int shared_mem_bytes, struct halide_type_t arg_types[], void *args[], int8_t is_buffer[])
This function triggers execution of OpenGL program built around compute shader.