Skip to content

Commit

Permalink
testing commit
Browse files Browse the repository at this point in the history
  • Loading branch information
omarahmed1111 committed Nov 3, 2023
1 parent ec44de3 commit ca4f87b
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 8 deletions.
19 changes: 19 additions & 0 deletions scripts/generate_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,25 @@ def _mako_info_hpp(path, namespace, tags, version, specs, meta):
specs=specs,
meta=meta)

"""
Entry-point:
generates linker version scripts
"""
def _mako_linker_scripts(path, ext, namespace, tags, version, specs, meta):
name = "adapter"
filename = f"{name}.{ext}.in"
fin = os.path.join(templates_dir, f"{filename}.mako")
fout = os.path.join(path, filename)
print("Generating %s..." % fout)
return util.makoWrite(
fin, fout,
name=name,
ver=version,
namespace=namespace,
tags=tags,
specs=specs,
meta=meta)

"""
Entry-point:
generates lib code
Expand Down
14 changes: 14 additions & 0 deletions scripts/templates/adapter.def.in.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<%!
import re
from templates import helper as th
%><%
n=namespace
N=n.upper()
x=tags['$x']
X=x.upper()
%>
LIBRARY @TARGET_LIBNAME@
EXPORTS
%for tbl in th.get_pfntables(specs, meta, n, tags):
${tbl['export']['name']}
%endfor
17 changes: 17 additions & 0 deletions scripts/templates/adapter.map.in.mako
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<%!
import re
from templates import helper as th
%><%
n=namespace
N=n.upper()
x=tags['$x']
X=x.upper()
%>
@TARGET_LIBNAME@ {
global:
%for tbl in th.get_pfntables(specs, meta, n, tags):
${tbl['export']['name']};
%endfor
local:
*;
};
8 changes: 5 additions & 3 deletions source/adapters/adapter.def.in
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
LIBRARY @TARGET_LIBNAME@
EXPORTS
urGetGlobalProcAddrTable
urGetBindlessImagesExpProcAddrTable
urGetCommandBufferExpProcAddrTable
urGetContextProcAddrTable
urGetDeviceProcAddrTable
urGetEnqueueProcAddrTable
urGetEnqueueExpProcAddrTable
urGetEventProcAddrTable
urGetGlobalProcAddrTable
urGetKernelProcAddrTable
urGetKernelExpProcAddrTable
urGetMemProcAddrTable
urGetPhysicalMemProcAddrTable
urGetPlatformProcAddrTable
urGetProgramProcAddrTable
urGetQueueProcAddrTable
urGetSamplerProcAddrTable
urGetUSMProcAddrTable
urGetUSMExpProcAddrTable
urGetUsmP2PExpProcAddrTable
urGetUSMProcAddrTable
urGetVirtualMemProcAddrTable
urGetDeviceProcAddrTable
10 changes: 6 additions & 4 deletions source/adapters/adapter.map.in
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
@TARGET_LIBNAME@ {
global:
urGetGlobalProcAddrTable;
urGetBindlessImagesExpProcAddrTable;
urGetCommandBufferExpProcAddrTable;
urGetContextProcAddrTable;
urGetDeviceProcAddrTable;
urGetEnqueueProcAddrTable;
urGetEnqueueExpProcAddrTable;
urGetEventProcAddrTable;
urGetGlobalProcAddrTable;
urGetKernelProcAddrTable;
urGetKernelExpProcAddrTable;
urGetMemProcAddrTable;
urGetPhysicalMemProcAddrTable;
urGetPlatformProcAddrTable;
urGetProgramProcAddrTable;
urGetQueueProcAddrTable;
urGetSamplerProcAddrTable;
urGetUSMProcAddrTable;
urGetUSMExpProcAddrTable;
urGetUsmP2PExpProcAddrTable;
urGetUSMProcAddrTable;
urGetVirtualMemProcAddrTable;
urGetDeviceProcAddrTable;
local:
*;
};
};
2 changes: 1 addition & 1 deletion source/adapters/cuda/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void detail::ur::assertion(bool Condition, const char *Message) {
}

void detail::ur::cuPrint(const char *Message) {
std::cerr << "ur_print: " << Message << std::endl;
std::fprintf(stderr, "ur_print: %s\n", Message);
}

// Global variables for ZER_EXT_RESULT_ADAPTER_SPECIFIC_ERROR
Expand Down
20 changes: 20 additions & 0 deletions source/adapters/cuda/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,26 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable(
return retVal;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
ur_api_version_t version, ur_enqueue_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelExpProcAddrTable(
ur_api_version_t version, ur_kernel_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

#if defined(__cplusplus)
} // extern "C"
#endif
20 changes: 20 additions & 0 deletions source/adapters/hip/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,26 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable(
return retVal;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
ur_api_version_t version, ur_enqueue_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelExpProcAddrTable(
ur_api_version_t version, ur_kernel_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

#if defined(__cplusplus)
} // extern "C"
#endif
20 changes: 20 additions & 0 deletions source/adapters/level_zero/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,3 +427,23 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable(

return retVal;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
ur_api_version_t version, ur_enqueue_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelExpProcAddrTable(
ur_api_version_t version, ur_kernel_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}
20 changes: 20 additions & 0 deletions source/adapters/opencl/ur_interface_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,26 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetPhysicalMemProcAddrTable(
return retVal;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable(
ur_api_version_t version, ur_enqueue_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

UR_DLLEXPORT ur_result_t UR_APICALL urGetKernelExpProcAddrTable(
ur_api_version_t version, ur_kernel_exp_dditable_t *pDdiTable) {
auto result = validateProcInputs(version, pDdiTable);
if (UR_RESULT_SUCCESS != result) {
return result;
}

return UR_RESULT_SUCCESS;
}

#if defined(__cplusplus)
} // extern "C"
#endif

0 comments on commit ca4f87b

Please sign in to comment.