Lines Matching refs:hwctx
84 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_buffer_free() local
85 CudaFunctions *cu = hwctx->internal->cuda_dl; in cuda_buffer_free()
89 CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx)); in cuda_buffer_free()
100 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_pool_alloc() local
101 CudaFunctions *cu = hwctx->internal->cuda_dl; in cuda_pool_alloc()
108 err = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx)); in cuda_pool_alloc()
130 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_frames_init() local
132 CudaFunctions *cu = hwctx->internal->cuda_dl; in cuda_frames_init()
147 hwctx->internal->cuda_device)); in cuda_frames_init()
226 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_transfer_data() local
227 CudaFunctions *cu = hwctx->internal->cuda_dl; in cuda_transfer_data()
236 ret = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx)); in cuda_transfer_data()
264 ret = CHECK_CU(cu->cuMemcpy2DAsync(&cpy, hwctx->stream)); in cuda_transfer_data()
270 ret = CHECK_CU(cu->cuStreamSynchronize(hwctx->stream)); in cuda_transfer_data()
283 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_device_uninit() local
285 if (hwctx->internal) { in cuda_device_uninit()
286 CudaFunctions *cu = hwctx->internal->cuda_dl; in cuda_device_uninit()
288 if (hwctx->internal->is_allocated && hwctx->cuda_ctx) { in cuda_device_uninit()
289 if (hwctx->internal->flags & AV_CUDA_USE_PRIMARY_CONTEXT) in cuda_device_uninit()
290 CHECK_CU(cu->cuDevicePrimaryCtxRelease(hwctx->internal->cuda_device)); in cuda_device_uninit()
292 CHECK_CU(cu->cuCtxDestroy(hwctx->cuda_ctx)); in cuda_device_uninit()
294 hwctx->cuda_ctx = NULL; in cuda_device_uninit()
297 cuda_free_functions(&hwctx->internal->cuda_dl); in cuda_device_uninit()
300 av_freep(&hwctx->internal); in cuda_device_uninit()
305 AVCUDADeviceContext *hwctx = ctx->hwctx; in cuda_device_init() local
308 if (!hwctx->internal) { in cuda_device_init()
309 hwctx->internal = av_mallocz(sizeof(*hwctx->internal)); in cuda_device_init()
310 if (!hwctx->internal) in cuda_device_init()
314 if (!hwctx->internal->cuda_dl) { in cuda_device_init()
315 ret = cuda_load_functions(&hwctx->internal->cuda_dl, ctx); in cuda_device_init()
330 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_context_init() local
338 cu = hwctx->internal->cuda_dl; in cuda_context_init()
340 hwctx->internal->flags = flags; in cuda_context_init()
343 ret = CHECK_CU(cu->cuDevicePrimaryCtxGetState(hwctx->internal->cuda_device, in cuda_context_init()
352 ret = CHECK_CU(cu->cuDevicePrimaryCtxSetFlags(hwctx->internal->cuda_device, in cuda_context_init()
358 ret = CHECK_CU(cu->cuDevicePrimaryCtxRetain(&hwctx->cuda_ctx, in cuda_context_init()
359 hwctx->internal->cuda_device)); in cuda_context_init()
363 ret = CHECK_CU(cu->cuCtxCreate(&hwctx->cuda_ctx, desired_flags, in cuda_context_init()
364 hwctx->internal->cuda_device)); in cuda_context_init()
371 hwctx->internal->is_allocated = 1; in cuda_context_init()
374 hwctx->stream = NULL; in cuda_context_init()
383 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_device_create() local
393 cu = hwctx->internal->cuda_dl; in cuda_device_create()
399 ret = CHECK_CU(cu->cuDeviceGet(&hwctx->internal->cuda_device, device_idx)); in cuda_device_create()
417 AVCUDADeviceContext *hwctx = device_ctx->hwctx; in cuda_device_derive() local
431 AVVulkanDeviceContext *vkctx = src_ctx->hwctx; in cuda_device_derive()
454 cu = hwctx->internal->cuda_dl; in cuda_device_derive()
464 hwctx->internal->cuda_device = -1; in cuda_device_derive()
478 hwctx->internal->cuda_device = dev; in cuda_device_derive()
483 if (hwctx->internal->cuda_device == -1) { in cuda_device_derive()