Skip to content

Commit c92b42a

Browse files
authored
[SYCLomatic] Add 11 cuda driver API query Mappings. (#2935)
Signed-off-by: Chen, Sheng S <sheng.s.chen@intel.com>
1 parent d50a05e commit c92b42a

18 files changed

+183
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Option: --use-experimental-features=virtual_mem
2+
#include <cuda.h>
3+
void test() {
4+
CUmemAllocationProp prop = {};
5+
CUmemGenericAllocationHandle allocHandle;
6+
// Start
7+
cuMemGetAllocationPropertiesFromHandle(&prop/*CUmemAllocationProp **/, allocHandle/*CUmemGenericAllocationHandle*/);
8+
// End
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Option: --use-experimental-features=bindless_images
2+
void test() {
3+
CUmipmappedArray mmArray;
4+
// Start
5+
cuMipmappedArrayDestroy(mmArray/*CUmipmappedArray*/);
6+
// End
7+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Option: --use-experimental-features=bindless_images
2+
void test() {
3+
CUmipmappedArray mmArray;
4+
CUarray level_arr;
5+
// Start
6+
cuMipmappedArrayGetLevel(&level_arr/*CUarray **/, mmArray/*CUmipmappedArray*/, 1/*unsigned int*/);
7+
// End
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Option: --usm-level=none
2+
#include <cuda.h>
3+
void test() {
4+
void *base_ptr;
5+
void *ptr;
6+
// Start
7+
cuPointerGetAttribute(base_ptr/*void **/, CU_POINTER_ATTRIBUTE_RANGE_START_ADDR/*CUpointer_attribute*/, (CUdeviceptr)ptr/*CUdeviceptr*/);
8+
// End
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <cuda.h>
2+
void test(CUstream stream, CUcontext& context) {
3+
// Start
4+
cuStreamGetCtx(stream/*CUstream*/, &context/*CUcontext **/);
5+
// End
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Option: --use-experimental-features=bindless_images
2+
#include <cuda.h>
3+
void test() {
4+
CUtexref r;
5+
// Start
6+
cuTexRefCreate(&r/*CUtexref **/);
7+
// End
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Option: --use-experimental-features=bindless_images
2+
#include <cuda.h>
3+
void test() {
4+
CUtexref r;
5+
// Start
6+
cuTexRefDestroy(r/*CUtexref*/);
7+
// End
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Option: --use-experimental-features=bindless_images
2+
#include <cuda.h>
3+
void test() {
4+
CUtexref r;
5+
CUarray a;
6+
// Start
7+
cuTexRefGetArray(&a/*CUarray **/, r/*CUtexref*/);
8+
// End
9+
}

clang/examples/DPCT/Driver/cuTexRefGetFlags.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <cuda.h>
12
void test(unsigned int *pu) {
23
// Start
34
CUtexref t;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Option: --use-experimental-features=bindless_images
2+
#include <cuda.h>
3+
void test() {
4+
CUfilter_mode fm = CU_TR_FILTER_MODE_POINT;
5+
CUtexref texRef;
6+
// Start
7+
cuTexRefGetMipmapFilterMode(&fm /*CUfilter_mode **/, texRef /*CUtexref*/);
8+
// End
9+
}

0 commit comments

Comments
 (0)