@@ -202,7 +202,7 @@ class HostKernel : public HostKernelBase {
202202 runOnHost (const NDRDescT &NDRDesc) {
203203 size_t XYZ[3 ] = {0 };
204204 sycl::id<Dims> ID;
205- sycl::range<Dims> Range;
205+ sycl::range<Dims> Range (InitializedVal<Dims, range>:: template get< 0 >()) ;
206206 for (int I = 0 ; I < Dims; ++I)
207207 Range[I] = NDRDesc.GlobalSize [I];
208208
@@ -226,7 +226,7 @@ class HostKernel : public HostKernelBase {
226226 typename std::enable_if<
227227 std::is_same<ArgT, item<Dims, /* Offset=*/ true >>::value>::type
228228 runOnHost (const NDRDescT &NDRDesc) {
229- sycl::range<Dims> Range;
229+ sycl::range<Dims> Range (InitializedVal<Dims, range>:: template get< 0 >()) ;
230230 sycl::id<Dims> Offset;
231231 for (int I = 0 ; I < Dims; ++I) {
232232 Range[I] = NDRDesc.GlobalSize [I];
@@ -253,16 +253,19 @@ class HostKernel : public HostKernelBase {
253253 template <class ArgT = KernelArgType>
254254 typename std::enable_if<std::is_same<ArgT, nd_item<Dims>>::value>::type
255255 runOnHost (const NDRDescT &NDRDesc) {
256- sycl::range<Dims> GroupSize;
256+ sycl::range<Dims> GroupSize (
257+ InitializedVal<Dims, range>::template get<0 >());
257258 for (int I = 0 ; I < Dims; ++I) {
258259 if (NDRDesc.LocalSize [I] == 0 ||
259260 NDRDesc.GlobalSize [I] % NDRDesc.LocalSize [I] != 0 )
260261 throw sycl::runtime_error (" Invalid local size for global size" );
261262 GroupSize[I] = NDRDesc.GlobalSize [I] / NDRDesc.LocalSize [I];
262263 }
263264
264- sycl::range<Dims> GlobalSize;
265- sycl::range<Dims> LocalSize;
265+ sycl::range<Dims> LocalSize (
266+ InitializedVal<Dims, range>::template get<0 >());
267+ sycl::range<Dims> GlobalSize (
268+ InitializedVal<Dims, range>::template get<0 >());
266269 sycl::id<Dims> GlobalOffset;
267270 for (int I = 0 ; I < Dims; ++I) {
268271 GlobalOffset[I] = NDRDesc.GlobalOffset [I];
@@ -291,17 +294,19 @@ class HostKernel : public HostKernelBase {
291294 template <typename ArgT = KernelArgType>
292295 enable_if_t <std::is_same<ArgT, cl::sycl::group<Dims>>::value>
293296 runOnHost (const NDRDescT &NDRDesc) {
294- sycl::range<Dims> NGroups;
297+ sycl::range<Dims> NGroups (InitializedVal<Dims, range>:: template get< 0 >()) ;
295298
296299 for (int I = 0 ; I < Dims; ++I) {
297300 if (NDRDesc.LocalSize [I] == 0 ||
298301 NDRDesc.GlobalSize [I] % NDRDesc.LocalSize [I] != 0 )
299302 throw sycl::runtime_error (" Invalid local size for global size" );
300303 NGroups[I] = NDRDesc.GlobalSize [I] / NDRDesc.LocalSize [I];
301304 }
302- sycl::range<Dims> GlobalSize;
303- sycl::range<Dims> LocalSize;
304305
306+ sycl::range<Dims> LocalSize (
307+ InitializedVal<Dims, range>::template get<0 >());
308+ sycl::range<Dims> GlobalSize (
309+ InitializedVal<Dims, range>::template get<0 >());
305310 for (int I = 0 ; I < Dims; ++I) {
306311 LocalSize[I] = NDRDesc.LocalSize [I];
307312 GlobalSize[I] = NDRDesc.GlobalSize [I];
0 commit comments