History

lavfi/opencl: add more opencl helper macro

Ruiling Song committed 7 years ago

Commit 0fc46461 parent 2be0bd11 file · +38 −0Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/opencl.h+38−0
@@ -73,6 +73,44 @@ typedef struct OpenCLFilterContext { · 72 unmodified lines
73 goto fail; \73 goto fail; \
74 } \74 } \
75 } while(0)75 } while(0)
76/**
77 * release an OpenCL Kernel
78 */
79#define CL_RELEASE_KERNEL(k) \
80do { \
81 if (k) { \
82 cle = clReleaseKernel(k); \
83 if (cle != CL_SUCCESS) \
84 av_log(avctx, AV_LOG_ERROR, "Failed to release " \
85 "OpenCL kernel: %d.\n", cle); \
86 } \
87} while(0)
88
89/**
90 * release an OpenCL Memory Object
91 */
92#define CL_RELEASE_MEMORY(m) \
93do { \
94 if (m) { \
95 cle = clReleaseMemObject(m); \
96 if (cle != CL_SUCCESS) \
97 av_log(avctx, AV_LOG_ERROR, "Failed to release " \
98 "OpenCL memory: %d.\n", cle); \
99 } \
100} while(0)
101
102/**
103 * release an OpenCL Command Queue
104 */
105#define CL_RELEASE_QUEUE(q) \
106do { \
107 if (q) { \
108 cle = clReleaseCommandQueue(q); \
109 if (cle != CL_SUCCESS) \
110 av_log(avctx, AV_LOG_ERROR, "Failed to release " \
111 "OpenCL command queue: %d.\n", cle); \
112 } \
113} while(0)
76 114
77/**115/**
78 * Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.116 * Return that all inputs and outputs support only AV_PIX_FMT_OPENCL.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t