@@ -75,28 +75,49 @@ void submit_kernel(DPCTLSyclQueueRef QRef,
75
75
a_ptr[i] = 0 ;
76
76
}
77
77
78
- auto la = MDLocalAccessor{1 , kernelArgTy, SIZE / 10 , 1 , 1 };
78
+ auto la1 = MDLocalAccessor{1 , kernelArgTy, SIZE / 10 , 1 , 1 };
79
79
80
80
// Create kernel args for vector_add
81
81
size_t gRange [] = {SIZE};
82
82
size_t lRange[] = {SIZE / 10 };
83
- void *args [NARGS] = {unwrap<void >(a), (void *)&la };
83
+ void *args_1d [NARGS] = {unwrap<void >(a), (void *)&la1 };
84
84
DPCTLKernelArgType addKernelArgTypes[] = {DPCTL_VOID_PTR,
85
85
DPCTL_LOCAL_ACCESSOR};
86
86
87
- auto ERef =
88
- DPCTLQueue_SubmitNDRange (kernel, QRef, args, addKernelArgTypes, NARGS,
89
- gRange , lRange, RANGE_NDIMS, nullptr , 0 );
90
- ASSERT_TRUE (ERef != nullptr );
91
- DPCTLQueue_Wait (QRef);
87
+ DPCTLSyclEventRef E1Ref = DPCTLQueue_SubmitNDRange (
88
+ kernel, QRef, args_1d, addKernelArgTypes, NARGS, gRange , lRange,
89
+ RANGE_NDIMS, nullptr , 0 );
90
+ ASSERT_TRUE (E1Ref != nullptr );
91
+
92
+ DPCTLSyclEventRef DepEv1[] = {E1Ref};
93
+ auto la2 = MDLocalAccessor{2 , kernelArgTy, SIZE / 10 , 1 , 1 };
94
+ void *args_2d[NARGS] = {unwrap<void >(a), (void *)&la2};
95
+
96
+ DPCTLSyclEventRef E2Ref =
97
+ DPCTLQueue_SubmitNDRange (kernel, QRef, args_2d, addKernelArgTypes,
98
+ NARGS, gRange , lRange, RANGE_NDIMS, DepEv1, 1 );
99
+ ASSERT_TRUE (E2Ref != nullptr );
100
+
101
+ DPCTLSyclEventRef DepEv2[] = {E1Ref, E2Ref};
102
+ auto la3 = MDLocalAccessor{3 , kernelArgTy, SIZE / 10 , 1 , 1 };
103
+ void *args_3d[NARGS] = {unwrap<void >(a), (void *)&la3};
104
+
105
+ DPCTLSyclEventRef E3Ref =
106
+ DPCTLQueue_SubmitNDRange (kernel, QRef, args_3d, addKernelArgTypes,
107
+ NARGS, gRange , lRange, RANGE_NDIMS, DepEv2, 2 );
108
+ ASSERT_TRUE (E3Ref != nullptr );
109
+
110
+ DPCTLEvent_Wait (E3Ref);
92
111
93
112
if (kernelArgTy != DPCTL_FLOAT32_T && kernelArgTy != DPCTL_FLOAT64_T)
94
113
ASSERT_TRUE (a_ptr[0 ] == 20 );
95
114
else
96
115
ASSERT_TRUE (a_ptr[0 ] == 20.0 );
97
116
98
117
// clean ups
99
- DPCTLEvent_Delete (ERef);
118
+ DPCTLEvent_Delete (E1Ref);
119
+ DPCTLEvent_Delete (E2Ref);
120
+ DPCTLEvent_Delete (E3Ref);
100
121
DPCTLKernel_Delete (kernel);
101
122
DPCTLfree_with_queue ((DPCTLSyclUSMRef)a, QRef);
102
123
}
0 commit comments