Halide 16.0.0
Halide compiler and libraries
Loading...
Searching...
No Matches
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
12extern "C" {
13#endif
14
15/** \file
16 * Routines specific to the Halide OpenGL Compute runtime.
17 */
18
19#define HALIDE_RUNTIME_OPENGLCOMPUTE
20
21HALIDE_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 */
31HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
32extern 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 */
41HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
42extern 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
52HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
53extern 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 */
61HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
62extern 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 */
69HALIDE_ATTRIBUTE_DEPRECATED("OpenGLCompute is deprecated in Halide 16 and will be removed in Halide 17.")
70extern int halide_opengl_create_context(void *user_context);
71
72#ifdef __cplusplus
73} // End extern "C"
74#endif
75
76#endif // HALIDE_HALIDERUNTIMEOPENGLCOMPUTE_H
This file declares the routines used by Halide internally in its runtime.
#define HALIDE_ATTRIBUTE_DEPRECATED(x)
int halide_opengl_create_context(void *user_context)
This function creates an OpenGL context for use by the OpenGL backend.
void halide_openglcompute_finalize_kernels(void *user_context, void *state_ptr)
const struct halide_device_interface_t * halide_openglcompute_device_interface()
void * halide_opengl_get_proc_address(void *user_context, const char *name)
This function retrieves pointers to OpenGL API functions.
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.
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.
This file defines the class FunctionDAG, which is our representation of a Halide pipeline,...
signed __INT8_TYPE__ int8_t
Each GPU API provides a halide_device_interface_t struct pointing to the code that manages device all...
A runtime tag for a type in the halide type system.