Skip to content

Commit 40f2626

Browse files
committed
change auto returns
1 parent fc61165 commit 40f2626

File tree

4 files changed

+51
-40
lines changed

4 files changed

+51
-40
lines changed

offload/plugins-nextgen/level_zero/include/L0Context.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class L0ContextTLSTy {
2424
StagingBufferTy StagingBuffer;
2525

2626
public:
27-
auto &getStagingBuffer() { return StagingBuffer; }
28-
const auto &getStagingBuffer() const { return StagingBuffer; }
27+
StagingBufferTy &getStagingBuffer() { return StagingBuffer; }
28+
const StagingBufferTy &getStagingBuffer() const { return StagingBuffer; }
2929

3030
Error deinit() { return StagingBuffer.clear(); }
3131
};
@@ -86,7 +86,7 @@ class L0ContextTy {
8686
Error init();
8787
Error deinit();
8888

89-
auto &getPlugin() const { return Plugin; }
89+
LevelZeroPluginTy &getPlugin() const { return Plugin; }
9090

9191
StagingBufferTy &getStagingBuffer();
9292

@@ -124,8 +124,8 @@ class L0ContextTy {
124124
ze_api_version_t getDriverAPIVersion() const { return APIVersion; }
125125

126126
/// Return the event pool of this driver
127-
auto &getEventPool() { return EventPool; }
128-
const auto &getEventPool() const { return EventPool; }
127+
EventPoolTy &getEventPool() { return EventPool; }
128+
const EventPoolTy &getEventPool() const { return EventPool; }
129129

130130
bool supportsLargeMem() const {
131131
// Large memory support is available since API version 1.1

offload/plugins-nextgen/level_zero/include/L0Device.h

Lines changed: 38 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -156,40 +156,44 @@ class L0DeviceTLSTy {
156156
L0DeviceTLSTy &operator=(const L0DeviceTLSTy &) = delete;
157157
L0DeviceTLSTy &operator=(L0DeviceTLSTy &&) = delete;
158158

159-
auto getCmdList() const { return CmdList; }
159+
ze_command_list_handle_t getCmdList() const { return CmdList; }
160160
void setCmdList(ze_command_list_handle_t _CmdList) { CmdList = _CmdList; }
161161

162-
auto getCopyCmdList() const { return CopyCmdList; }
162+
ze_command_list_handle_t getCopyCmdList() const { return CopyCmdList; }
163163
void setCopyCmdList(ze_command_list_handle_t _CopyCmdList) {
164164
CopyCmdList = _CopyCmdList;
165165
}
166166

167-
auto getLinkCopyCmdList() const { return LinkCopyCmdList; }
167+
ze_command_list_handle_t getLinkCopyCmdList() const {
168+
return LinkCopyCmdList;
169+
}
168170
void setLinkCopyCmdList(ze_command_list_handle_t _LinkCopyCmdList) {
169171
LinkCopyCmdList = _LinkCopyCmdList;
170172
}
171173

172-
auto getImmCmdList() const { return ImmCmdList; }
174+
ze_command_list_handle_t getImmCmdList() const { return ImmCmdList; }
173175
void setImmCmdList(ze_command_list_handle_t ImmCmdListIn) {
174176
ImmCmdList = ImmCmdListIn;
175177
}
176178

177-
auto getImmCopyCmdList() const { return ImmCopyCmdList; }
179+
ze_command_list_handle_t getImmCopyCmdList() const { return ImmCopyCmdList; }
178180
void setImmCopyCmdList(ze_command_list_handle_t ImmCopyCmdListIn) {
179181
ImmCopyCmdList = ImmCopyCmdListIn;
180182
}
181183

182-
auto getCmdQueue() const { return CmdQueue; }
184+
ze_command_queue_handle_t getCmdQueue() const { return CmdQueue; }
183185
void setCmdQueue(ze_command_queue_handle_t CmdQueueIn) {
184186
CmdQueue = CmdQueueIn;
185187
}
186188

187-
auto getCopyCmdQueue() const { return CopyCmdQueue; }
189+
ze_command_queue_handle_t getCopyCmdQueue() const { return CopyCmdQueue; }
188190
void setCopyCmdQueue(ze_command_queue_handle_t CopyCmdQueueIn) {
189191
CopyCmdQueue = CopyCmdQueueIn;
190192
}
191193

192-
auto getLinkCopyCmdQueue() const { return LinkCopyCmdQueue; }
194+
ze_command_queue_handle_t getLinkCopyCmdQueue() const {
195+
return LinkCopyCmdQueue;
196+
}
193197
void setLinkCopyCmdQueue(ze_command_queue_handle_t LinkCopyCmdQueueIn) {
194198
LinkCopyCmdQueue = LinkCopyCmdQueueIn;
195199
}
@@ -288,13 +292,13 @@ class L0DeviceTy final : public GenericDeviceTy {
288292
return static_cast<L0DeviceTy &>(Device);
289293
}
290294

291-
auto &getPlugin() { return (LevelZeroPluginTy &)Plugin; }
295+
LevelZeroPluginTy &getPlugin() { return (LevelZeroPluginTy &)Plugin; }
292296
L0DeviceTLSTy &getTLS();
293297

294298
Error setContext() override { return Plugin::success(); }
295299
Error initImpl(GenericPluginTy &Plugin) override;
296300
Error deinitImpl() override;
297-
auto getZeDevice() const { return zeDevice; }
301+
ze_device_handle_t getZeDevice() const { return zeDevice; }
298302

299303
const L0ContextTy &getL0Context() const { return l0Context; }
300304
L0ContextTy &getL0Context() { return l0Context; }
@@ -307,14 +311,16 @@ class L0DeviceTy final : public GenericDeviceTy {
307311

308312
std::mutex &getMutex() { return Mutex; }
309313

310-
auto getComputeIndex() const { return ComputeIndex; }
311-
auto getIndirectFlags() const { return IndirectAccessFlags; }
314+
uint32_t getComputeIndex() const { return ComputeIndex; }
315+
ze_kernel_indirect_access_flags_t getIndirectFlags() const {
316+
return IndirectAccessFlags;
317+
}
312318

313-
auto getNumGlobalModules() const { return GlobalModules.size(); }
319+
size_t getNumGlobalModules() const { return GlobalModules.size(); }
314320
void addGlobalModule(ze_module_handle_t Module) {
315321
GlobalModules.push_back(Module);
316322
}
317-
auto getGlobalModulesArray() { return GlobalModules.data(); }
323+
ze_module_handle_t *getGlobalModulesArray() { return GlobalModules.data(); }
318324

319325
L0ProgramTy *getProgramFromImage(MemoryBufferRef Image) {
320326
for (auto &PGM : Programs)
@@ -332,42 +338,45 @@ class L0DeviceTy final : public GenericDeviceTy {
332338
}
333339

334340
// add a new program to the device. Return a reference to the new program
335-
auto &addProgram(int32_t ImageId, std::unique_ptr<MemoryBuffer> &&Image) {
341+
L0ProgramTy &addProgram(int32_t ImageId,
342+
std::unique_ptr<MemoryBuffer> &&Image) {
336343
Programs.emplace_back(ImageId, *this, std::move(Image));
337344
return Programs.back();
338345
}
339346

340-
const auto &getLastProgram() const { return Programs.back(); }
341-
auto &getLastProgram() { return Programs.back(); }
347+
const L0ProgramTy &getLastProgram() const { return Programs.back(); }
348+
L0ProgramTy &getLastProgram() { return Programs.back(); }
342349
// Device properties getters
343-
auto getVendorId() const { return DeviceProperties.vendorId; }
350+
uint32_t getVendorId() const { return DeviceProperties.vendorId; }
344351
bool isGPU() const { return DeviceProperties.type == ZE_DEVICE_TYPE_GPU; }
345352

346-
auto getPCIId() const { return DeviceProperties.deviceId; }
347-
auto getNumThreadsPerEU() const { return DeviceProperties.numThreadsPerEU; }
348-
auto getSIMDWidth() const { return DeviceProperties.physicalEUSimdWidth; }
349-
auto getNumEUsPerSubslice() const {
353+
uint32_t getPCIId() const { return DeviceProperties.deviceId; }
354+
uint32_t getNumThreadsPerEU() const {
355+
return DeviceProperties.numThreadsPerEU;
356+
}
357+
uint32_t getSIMDWidth() const { return DeviceProperties.physicalEUSimdWidth; }
358+
uint32_t getNumEUsPerSubslice() const {
350359
return DeviceProperties.numEUsPerSubslice;
351360
}
352-
auto getNumSubslicesPerSlice() const {
361+
uint32_t getNumSubslicesPerSlice() const {
353362
return DeviceProperties.numSubslicesPerSlice;
354363
}
355-
auto getNumSlices() const { return DeviceProperties.numSlices; }
356-
auto getNumSubslices() const {
364+
uint32_t getNumSlices() const { return DeviceProperties.numSlices; }
365+
uint32_t getNumSubslices() const {
357366
return DeviceProperties.numSubslicesPerSlice * DeviceProperties.numSlices;
358367
}
359368
uint32_t getNumEUs() const {
360369
return DeviceProperties.numEUsPerSubslice * getNumSubslices();
361370
}
362-
auto getTotalThreads() const {
371+
uint32_t getTotalThreads() const {
363372
return DeviceProperties.numThreadsPerEU * getNumEUs();
364373
}
365-
auto getNumThreadsPerSubslice() const {
374+
uint32_t getNumThreadsPerSubslice() const {
366375
return getNumEUsPerSubslice() * getNumThreadsPerEU();
367376
}
368-
auto getClockRate() const { return DeviceProperties.coreClockRate; }
377+
uint32_t getClockRate() const { return DeviceProperties.coreClockRate; }
369378

370-
auto getMaxSharedLocalMemory() const {
379+
uint32_t getMaxSharedLocalMemory() const {
371380
return ComputeProperties.maxSharedLocalMemory;
372381
}
373382
auto getMaxGroupSize() const { return ComputeProperties.maxTotalGroupSize; }

offload/plugins-nextgen/level_zero/include/L0Kernel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class L0KernelTy : public GenericKernelTy {
108108
ze_kernel_handle_t zeKernel;
109109
// Kernel Properties
110110
KernelPropertiesTy Properties;
111-
auto &getProperties() { return Properties; }
111+
KernelPropertiesTy &getProperties() { return Properties; }
112112

113113
Error runTargetTeamRegion(L0DeviceTy &Device, KernelArgsTy &KernelArgs,
114114
KernelLaunchParamsTy LaunchParams,
@@ -140,7 +140,7 @@ class L0KernelTy : public GenericKernelTy {
140140
L0KernelTy &operator=(const L0KernelTy &) = delete;
141141
L0KernelTy &operator=(const L0KernelTy &&) = delete;
142142

143-
const auto &getProperties() const { return Properties; }
143+
const KernelPropertiesTy &getProperties() const { return Properties; }
144144

145145
/// Initialize the L0 kernel.
146146
Error initImpl(GenericDeviceTy &GenericDevice, DeviceImageTy &Image) override;

offload/plugins-nextgen/level_zero/include/L0Plugin.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LevelZeroPluginTy final : public GenericPluginTy {
4949
/// Common pool of AsyncQueue
5050
AsyncQueuePoolTy AsyncQueuePool;
5151

52-
auto &getTLS() { return ThreadTLSTable.get(); }
52+
L0ThreadTLSTy &getTLS() { return ThreadTLSTable.get(); }
5353

5454
/// Find L0 devices and initialize device properties.
5555
/// Returns number of devices reported to omptarget.
@@ -59,12 +59,14 @@ class LevelZeroPluginTy final : public GenericPluginTy {
5959
LevelZeroPluginTy() : GenericPluginTy(getTripleArch()) {}
6060
virtual ~LevelZeroPluginTy() {}
6161

62-
auto &getDeviceTLS(int32_t DeviceId) { return DeviceTLSTable.get(DeviceId); }
63-
auto &getContextTLS(ze_context_handle_t Context) {
62+
L0DeviceTLSTy &getDeviceTLS(int32_t DeviceId) {
63+
return DeviceTLSTable.get(DeviceId);
64+
}
65+
L0ContextTLSTy &getContextTLS(ze_context_handle_t Context) {
6466
return ContextTLSTable.get(Context);
6567
}
6668

67-
static const auto &getOptions() { return Options; }
69+
static const L0OptionsTy &getOptions() { return Options; }
6870

6971
L0DeviceTy &getDeviceFromId(int32_t DeviceId) const {
7072
return static_cast<L0DeviceTy &>(getDevice(DeviceId));

0 commit comments

Comments
 (0)