Skip to content

Commit f94550b

Browse files
committed
[NATIVECPU] Add missing DDI table entries for BindlessImagesExp, CommandBufferExp, PhysicalMem, USMExp, VirtualMem.
1 parent 02baece commit f94550b

File tree

1 file changed

+104
-1
lines changed

1 file changed

+104
-1
lines changed

source/adapters/native_cpu/ur_interface_loader.cpp

Lines changed: 104 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,32 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetDeviceProcAddrTable(
262262
return UR_RESULT_SUCCESS;
263263
}
264264

265-
// TODO: CommandBuffer
265+
UR_DLLEXPORT ur_result_t UR_APICALL urGetCommandBufferExpProcAddrTable(
266+
ur_api_version_t version, ur_command_buffer_exp_dditable_t *pDdiTable) {
267+
auto retVal = validateProcInputs(version, pDdiTable);
268+
if (UR_RESULT_SUCCESS != retVal) {
269+
return retVal;
270+
}
271+
pDdiTable->pfnCreateExp = urCommandBufferCreateExp;
272+
pDdiTable->pfnRetainExp = urCommandBufferRetainExp;
273+
pDdiTable->pfnReleaseExp = urCommandBufferReleaseExp;
274+
pDdiTable->pfnFinalizeExp = urCommandBufferFinalizeExp;
275+
pDdiTable->pfnAppendKernelLaunchExp = urCommandBufferAppendKernelLaunchExp;
276+
pDdiTable->pfnAppendMemcpyUSMExp = urCommandBufferAppendMemcpyUSMExp;
277+
pDdiTable->pfnAppendMembufferCopyExp = urCommandBufferAppendMembufferCopyExp;
278+
pDdiTable->pfnAppendMembufferCopyRectExp =
279+
urCommandBufferAppendMembufferCopyRectExp;
280+
pDdiTable->pfnAppendMembufferReadExp = urCommandBufferAppendMembufferReadExp;
281+
pDdiTable->pfnAppendMembufferReadRectExp =
282+
urCommandBufferAppendMembufferReadRectExp;
283+
pDdiTable->pfnAppendMembufferWriteExp =
284+
urCommandBufferAppendMembufferWriteExp;
285+
pDdiTable->pfnAppendMembufferWriteRectExp =
286+
urCommandBufferAppendMembufferWriteRectExp;
287+
pDdiTable->pfnEnqueueExp = urCommandBufferEnqueueExp;
288+
289+
return retVal;
290+
}
266291

267292
UR_DLLEXPORT ur_result_t UR_APICALL urGetUsmP2PExpProcAddrTable(
268293
ur_api_version_t version, ur_usm_p2p_exp_dditable_t *pDdiTable) {
@@ -277,4 +302,82 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUsmP2PExpProcAddrTable(
277302
return retVal;
278303
}
279304

305+
UR_DLLEXPORT ur_result_t UR_APICALL urGetBindlessImagesExpProcAddrTable(
306+
ur_api_version_t version, ur_bindless_images_exp_dditable_t *pDdiTable) {
307+
auto result = validateProcInputs(version, pDdiTable);
308+
if (UR_RESULT_SUCCESS != result) {
309+
return result;
310+
}
311+
pDdiTable->pfnUnsampledImageHandleDestroyExp =
312+
urBindlessImagesUnsampledImageHandleDestroyExp;
313+
pDdiTable->pfnSampledImageHandleDestroyExp =
314+
urBindlessImagesSampledImageHandleDestroyExp;
315+
pDdiTable->pfnImageAllocateExp = urBindlessImagesImageAllocateExp;
316+
pDdiTable->pfnImageFreeExp = urBindlessImagesImageFreeExp;
317+
pDdiTable->pfnUnsampledImageCreateExp =
318+
urBindlessImagesUnsampledImageCreateExp;
319+
pDdiTable->pfnSampledImageCreateExp = urBindlessImagesSampledImageCreateExp;
320+
pDdiTable->pfnImageCopyExp = urBindlessImagesImageCopyExp;
321+
pDdiTable->pfnImageGetInfoExp = urBindlessImagesImageGetInfoExp;
322+
pDdiTable->pfnMipmapGetLevelExp = urBindlessImagesMipmapGetLevelExp;
323+
pDdiTable->pfnMipmapFreeExp = urBindlessImagesMipmapFreeExp;
324+
pDdiTable->pfnImportOpaqueFDExp = urBindlessImagesImportOpaqueFDExp;
325+
pDdiTable->pfnMapExternalArrayExp = urBindlessImagesMapExternalArrayExp;
326+
pDdiTable->pfnReleaseInteropExp = urBindlessImagesReleaseInteropExp;
327+
pDdiTable->pfnImportExternalSemaphoreOpaqueFDExp =
328+
urBindlessImagesImportExternalSemaphoreOpaqueFDExp;
329+
pDdiTable->pfnDestroyExternalSemaphoreExp =
330+
urBindlessImagesDestroyExternalSemaphoreExp;
331+
pDdiTable->pfnWaitExternalSemaphoreExp =
332+
urBindlessImagesWaitExternalSemaphoreExp;
333+
pDdiTable->pfnSignalExternalSemaphoreExp =
334+
urBindlessImagesSignalExternalSemaphoreExp;
335+
return UR_RESULT_SUCCESS;
336+
}
337+
338+
UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable(
339+
ur_api_version_t version, ur_physical_mem_dditable_t *pDdiTable) {
340+
auto retVal = validateProcInputs(version, pDdiTable);
341+
if (UR_RESULT_SUCCESS != retVal) {
342+
return retVal;
343+
}
344+
345+
pDdiTable->pfnCreate = nullptr;
346+
pDdiTable->pfnRelease = nullptr;
347+
pDdiTable->pfnRetain = nullptr;
348+
349+
return retVal;
350+
}
351+
352+
UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable(
353+
ur_api_version_t version, ur_usm_exp_dditable_t *pDdiTable) {
354+
auto result = validateProcInputs(version, pDdiTable);
355+
if (UR_RESULT_SUCCESS != result) {
356+
return result;
357+
}
358+
pDdiTable->pfnPitchedAllocExp = urUSMPitchedAllocExp;
359+
return UR_RESULT_SUCCESS;
360+
}
361+
362+
UR_DLLEXPORT ur_result_t UR_APICALL urGetVirtualMemProcAddrTable(
363+
ur_api_version_t version, ///< [in] API version requested
364+
ur_virtual_mem_dditable_t
365+
*pDdiTable ///< [in,out] pointer to table of DDI function pointers
366+
) {
367+
auto retVal = validateProcInputs(version, pDdiTable);
368+
if (UR_RESULT_SUCCESS != retVal) {
369+
return retVal;
370+
}
371+
372+
pDdiTable->pfnFree = nullptr;
373+
pDdiTable->pfnGetInfo = nullptr;
374+
pDdiTable->pfnGranularityGetInfo = nullptr;
375+
pDdiTable->pfnMap = nullptr;
376+
pDdiTable->pfnReserve = nullptr;
377+
pDdiTable->pfnSetAccess = nullptr;
378+
pDdiTable->pfnUnmap = nullptr;
379+
380+
return retVal;
381+
}
382+
280383
} // extern "C"

0 commit comments

Comments
 (0)