File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
source/adapters/native_cpu Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change 7
7
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8
8
//
9
9
// ===----------------------------------------------------------------------===//
10
-
11
10
#include < array>
12
11
#include < cstdint>
13
12
@@ -77,6 +76,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
77
76
for (unsigned g2 = 0 ; g2 < numWG2; g2++) {
78
77
for (unsigned g1 = 0 ; g1 < numWG1; g1++) {
79
78
for (unsigned g0 = 0 ; g0 < numWG0; g0++) {
79
+ #ifdef NATIVECPU_USE_OCK
80
+ state.update (g0, g1, g2);
81
+ hKernel->_subhandler (hKernel->_args .data (), &state);
82
+ #else
80
83
for (unsigned local2 = 0 ; local2 < ndr.LocalSize [2 ]; local2++) {
81
84
for (unsigned local1 = 0 ; local1 < ndr.LocalSize [1 ]; local1++) {
82
85
for (unsigned local0 = 0 ; local0 < ndr.LocalSize [0 ]; local0++) {
@@ -85,6 +88,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueKernelLaunch(
85
88
}
86
89
}
87
90
}
91
+ #endif
88
92
}
89
93
}
90
94
}
Original file line number Diff line number Diff line change @@ -53,6 +53,12 @@ struct state {
53
53
MGlobal_id[2 ] =
54
54
MWorkGroup_size[2 ] * MWorkGroup_id[2 ] + MLocal_id[2 ] + MGlobalOffset[2 ];
55
55
}
56
+
57
+ void update (size_t group0, size_t group1, size_t group2) {
58
+ MWorkGroup_id[0 ] = group0;
59
+ MWorkGroup_id[1 ] = group1;
60
+ MWorkGroup_id[2 ] = group2;
61
+ }
56
62
};
57
63
58
64
} // namespace native_cpu
You can’t perform that action at this time.
0 commit comments