@@ -92,14 +92,15 @@ static RT::PiProgram createBinaryProgram(const ContextImplPtr Context,
92
92
if (Backend == backend::cuda) {
93
93
// TODO: Reemplace CreateWithSource with CreateWithBinary in CUDA backend
94
94
const char *SignedData = reinterpret_cast <const char *>(Data);
95
- Plugin.call <PiApiKind::piclProgramCreateWithSource>(Context->getHandleRef (), 1 /* one binary*/ , &SignedData,
96
- &DataLen, &Program);
95
+ Plugin.call <PiApiKind::piclProgramCreateWithSource>(
96
+ Context->getHandleRef (), 1 /* one binary*/ , &SignedData, &DataLen,
97
+ &Program);
97
98
} else {
98
99
RT::PiDevice Device = getFirstDevice (Context);
99
100
pi_int32 BinaryStatus = CL_SUCCESS;
100
- Plugin.call <PiApiKind::piclProgramCreateWithBinary>(Context-> getHandleRef (), 1 /* one binary */ , &Device,
101
- &DataLen , &Data , &BinaryStatus ,
102
- &Program);
101
+ Plugin.call <PiApiKind::piclProgramCreateWithBinary>(
102
+ Context-> getHandleRef (), 1 /* one binary */ , &Device , &DataLen , &Data ,
103
+ &BinaryStatus, &Program);
103
104
}
104
105
105
106
return Program;
@@ -189,7 +190,7 @@ RetT *getOrBuild(KernelProgramCache &KPCache, KeyT &&CacheKey,
189
190
RetT *Result = waitUntilBuilt<ExceptionT>(KPCache, BuildResult);
190
191
191
192
if (Result)
192
- return Result;
193
+ return Result;
193
194
194
195
// Previous build is failed. There was no SYCL exception though.
195
196
// We might try to build once more.
@@ -360,7 +361,7 @@ RT::PiProgram ProgramManager::getBuiltPIProgram(OSModuleHandle M,
360
361
auto AcquireF = [](KernelProgramCache &Cache) {
361
362
return Cache.acquireCachedPrograms ();
362
363
};
363
- auto GetF = [](const Locked<ProgramCacheT> &LockedCache) -> ProgramCacheT& {
364
+ auto GetF = [](const Locked<ProgramCacheT> &LockedCache) -> ProgramCacheT & {
364
365
return LockedCache.get ();
365
366
};
366
367
auto BuildF = [this , &M, &KSId, &Context, Prg] {
@@ -381,9 +382,10 @@ RT::PiProgram ProgramManager::getBuiltPIProgram(OSModuleHandle M,
381
382
382
383
const std::vector<device> &Devices = ContextImpl->getDevices ();
383
384
std::vector<RT::PiDevice> PiDevices (Devices.size ());
384
- std::transform (
385
- Devices.begin (), Devices.end (), PiDevices.begin (),
386
- [](const device Dev) { return getRawSyclObjImpl (Dev)->getHandleRef (); });
385
+ std::transform (Devices.begin (), Devices.end (), PiDevices.begin (),
386
+ [](const device Dev) {
387
+ return getRawSyclObjImpl (Dev)->getHandleRef ();
388
+ });
387
389
388
390
ProgramPtr BuiltProgram =
389
391
build (std::move (ProgramManaged), ContextImpl, Img.getCompileOptions (),
@@ -420,10 +422,11 @@ RT::PiKernel ProgramManager::getOrCreateKernel(OSModuleHandle M,
420
422
421
423
KernelProgramCache &Cache = Ctx->getKernelProgramCache ();
422
424
423
- auto AcquireF = [] (KernelProgramCache &Cache) {
425
+ auto AcquireF = [](KernelProgramCache &Cache) {
424
426
return Cache.acquireKernelsPerProgramCache ();
425
427
};
426
- auto GetF = [&Program] (const Locked<KernelCacheT> &LockedCache) -> KernelByNameT& {
428
+ auto GetF =
429
+ [&Program](const Locked<KernelCacheT> &LockedCache) -> KernelByNameT & {
427
430
return LockedCache.get ()[Program];
428
431
};
429
432
auto BuildF = [this , &Program, &KernelName, &Ctx] {
@@ -438,8 +441,8 @@ RT::PiKernel ProgramManager::getOrCreateKernel(OSModuleHandle M,
438
441
return Result;
439
442
};
440
443
441
- return getOrBuild<PiKernelT, invalid_object_error>(
442
- Cache, KernelName, AcquireF, GetF, BuildF);
444
+ return getOrBuild<PiKernelT, invalid_object_error>(Cache, KernelName,
445
+ AcquireF, GetF, BuildF);
443
446
}
444
447
445
448
RT::PiProgram
@@ -506,7 +509,7 @@ static bool loadDeviceLib(const ContextImplPtr Context, const char *Name,
506
509
return Prog != nullptr ;
507
510
}
508
511
509
- static const char * getDeviceLibFilename (DeviceLibExt Extension) {
512
+ static const char * getDeviceLibFilename (DeviceLibExt Extension) {
510
513
switch (Extension) {
511
514
case cl_intel_devicelib_assert:
512
515
return " libsycl-fallback-cassert.spv" ;
@@ -523,7 +526,7 @@ static const char* getDeviceLibFilename(DeviceLibExt Extension) {
523
526
PI_INVALID_OPERATION);
524
527
}
525
528
526
- static const char * getDeviceLibExtensionStr (DeviceLibExt Extension) {
529
+ static const char * getDeviceLibExtensionStr (DeviceLibExt Extension) {
527
530
switch (Extension) {
528
531
case cl_intel_devicelib_assert:
529
532
return " cl_intel_devicelib_assert" ;
@@ -673,18 +676,17 @@ getDeviceLibPrograms(const ContextImplPtr Context,
673
676
{cl_intel_devicelib_math, false },
674
677
{cl_intel_devicelib_math_fp64, false },
675
678
{cl_intel_devicelib_complex, false },
676
- {cl_intel_devicelib_complex_fp64, false }
677
- };
679
+ {cl_intel_devicelib_complex_fp64, false }};
678
680
679
681
// Disable all devicelib extensions requiring fp64 support if at least
680
682
// one underlying device doesn't support cl_khr_fp64.
681
683
bool fp64Support = true ;
682
684
for (RT::PiDevice Dev : Devices) {
683
685
std::string DevExtList =
684
- get_device_info<std::string, info::device::extensions>::get (
686
+ get_device_info<std::string, info::device::extensions>::get (
685
687
Dev, Context->getPlugin ());
686
- fp64Support = fp64Support &&
687
- (DevExtList.npos != DevExtList.find (" cl_khr_fp64" ));
688
+ fp64Support =
689
+ fp64Support && (DevExtList.npos != DevExtList.find (" cl_khr_fp64" ));
688
690
}
689
691
690
692
// Load a fallback library for an extension if at least one device does not
@@ -702,11 +704,12 @@ getDeviceLibPrograms(const ContextImplPtr Context,
702
704
}
703
705
704
706
if ((Ext == cl_intel_devicelib_math_fp64 ||
705
- Ext == cl_intel_devicelib_complex_fp64) && !fp64Support) {
707
+ Ext == cl_intel_devicelib_complex_fp64) &&
708
+ !fp64Support) {
706
709
continue ;
707
710
}
708
711
709
- const char * ExtStr = getDeviceLibExtensionStr (Ext);
712
+ const char * ExtStr = getDeviceLibExtensionStr (Ext);
710
713
711
714
bool InhibitNativeImpl = false ;
712
715
if (const char *Env = getenv (" SYCL_DEVICELIB_INHIBIT_NATIVE" )) {
@@ -823,8 +826,7 @@ void ProgramManager::addImages(pi_device_binaries DeviceBinary) {
823
826
KernelSetId KSId = getNextKernelSetId ();
824
827
for (_pi_offload_entry EntriesIt = EntriesB; EntriesIt != EntriesE;
825
828
++EntriesIt) {
826
- auto Result =
827
- KSIdMap.insert (std::make_pair (EntriesIt->name , KSId));
829
+ auto Result = KSIdMap.insert (std::make_pair (EntriesIt->name , KSId));
828
830
(void )Result;
829
831
assert (Result.second && " Kernel sets are not disjoint" );
830
832
}
0 commit comments