This repository was archived by the owner on May 9, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 7 files changed +25
-19
lines changed Expand file tree Collapse file tree 7 files changed +25
-19
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,8 @@ class CudaMgr : public GpuMgr {
164
164
return getMinNumMPsForAllDevices ();
165
165
};
166
166
167
+ bool hasFP64Support () const override { return isArchPascalOrLater (); }
168
+
167
169
bool hasSharedMemoryAtomicsSupport () const override {
168
170
/*
169
171
* From CUDA Toolkit documentation:
Original file line number Diff line number Diff line change @@ -62,5 +62,7 @@ struct GpuMgr {
62
62
virtual uint32_t getGridSize () const = 0;
63
63
virtual uint32_t getMinEUNumForAllDevices () const = 0;
64
64
virtual bool hasSharedMemoryAtomicsSupport () const = 0;
65
+ // TODO: hasFP64Support implementations do not account for different device capabilities
66
+ virtual bool hasFP64Support () const { return true ; };
65
67
virtual size_t getMinSharedMemoryPerBlockForAllDevices () const = 0;
66
68
};
Original file line number Diff line number Diff line change @@ -451,6 +451,14 @@ bool L0Manager::hasSharedMemoryAtomicsSupport() const {
451
451
return true ;
452
452
}
453
453
454
+ bool L0Manager::hasFP64Support () const {
455
+ CHECK_GT (drivers_[0 ]->devices ().size (), size_t (0 ));
456
+ ze_device_module_properties_t module_props{ZE_STRUCTURE_TYPE_DEVICE_MODULE_PROPERTIES};
457
+ L0_SAFE_CALL (
458
+ zeDeviceGetModuleProperties (drivers_[0 ]->devices ()[0 ]->device (), &module_props));
459
+ return module_props.fp64flags ;
460
+ }
461
+
454
462
size_t L0Manager::getMinSharedMemoryPerBlockForAllDevices () const {
455
463
auto comp = [](const auto & a, const auto & b) {
456
464
return a->maxSharedLocalMemory () < b->maxSharedLocalMemory ();
Original file line number Diff line number Diff line change @@ -239,12 +239,13 @@ class L0Manager : public GpuMgr {
239
239
size_t getMaxAllocationSize (const int device_num) const ;
240
240
size_t getPageSize (const int device_num) const { return 4096u ; }
241
241
242
- virtual uint32_t getMaxBlockSize () const override ;
243
- virtual int8_t getSubGroupSize () const override ;
244
- virtual uint32_t getGridSize () const override ;
245
- virtual uint32_t getMinEUNumForAllDevices () const override ;
246
- virtual bool hasSharedMemoryAtomicsSupport () const override ;
247
- virtual size_t getMinSharedMemoryPerBlockForAllDevices () const override ;
242
+ uint32_t getMaxBlockSize () const override ;
243
+ int8_t getSubGroupSize () const override ;
244
+ uint32_t getGridSize () const override ;
245
+ uint32_t getMinEUNumForAllDevices () const override ;
246
+ bool hasSharedMemoryAtomicsSupport () const override ;
247
+ bool hasFP64Support () const override ;
248
+ size_t getMinSharedMemoryPerBlockForAllDevices () const override ;
248
249
249
250
const std::vector<std::shared_ptr<L0Driver>>& drivers () const ;
250
251
Original file line number Diff line number Diff line change @@ -148,6 +148,11 @@ size_t L0Manager::getMinSharedMemoryPerBlockForAllDevices() const {
148
148
return 0u ;
149
149
};
150
150
151
+ bool L0Manager::hasFP64Support () const {
152
+ CHECK (false );
153
+ return false ;
154
+ }
155
+
151
156
const std::vector<std::shared_ptr<L0Driver>>& L0Manager::drivers () const {
152
157
return drivers_;
153
158
}
Original file line number Diff line number Diff line change @@ -880,19 +880,9 @@ GpuMgr* Executor::gpuMgr() const {
880
880
return gpu_mgr;
881
881
}
882
882
883
- bool Executor::isArchPascalOrLater (const ExecutorDeviceType dt) const {
884
- if (dt == ExecutorDeviceType::GPU) {
885
- return gpuMgr ()->getPlatform () == GpuMgrPlatform::CUDA
886
- ? cudaMgr ()->isArchPascalOrLater ()
887
- : false ;
888
- }
889
- return false ;
890
- }
891
-
892
883
bool Executor::deviceSupportsFP64 (const ExecutorDeviceType dt) const {
893
884
if (dt == ExecutorDeviceType::GPU) {
894
- return gpuMgr ()->getPlatform () == GpuMgrPlatform::CUDA ? isArchPascalOrLater (dt)
895
- : true ;
885
+ return gpuMgr ()->hasFP64Support ();
896
886
}
897
887
return true ;
898
888
}
Original file line number Diff line number Diff line change @@ -431,8 +431,6 @@ class Executor : public StringDictionaryProxyProvider {
431
431
432
432
GpuMgr* gpuMgr () const ;
433
433
434
- bool isArchPascalOrLater (const ExecutorDeviceType dt) const ;
435
-
436
434
bool deviceSupportsFP64 (const ExecutorDeviceType dt) const ;
437
435
438
436
bool needFetchAllFragments (const InputColDescriptor& col_desc,
You can’t perform that action at this time.
0 commit comments