Skip to content

Commit 6a83d3e

Browse files
committed
PR feedback
1 parent 771b743 commit 6a83d3e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

source/adapters/cuda/device.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -1145,15 +1145,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
11451145

11461146
std::vector<ur_platform_handle_t> Platforms(NumPlatforms);
11471147

1148-
Result = urPlatformGet(&AdapterHandle, 1, Platforms.size(), Platforms.data(),
1149-
nullptr);
1148+
Result =
1149+
urPlatformGet(&AdapterHandle, 1, NumPlatforms, Platforms.data(), nullptr);
11501150
if (Result != UR_RESULT_SUCCESS)
11511151
return Result;
11521152

11531153
// Iterate through platforms to find device that matches nativeHandle
1154-
for (auto Platform : Platforms) {
1155-
auto SearchRes = std::find_if(begin(Platform->Devices),
1156-
end(Platform->Devices), IsDevice);
1154+
for (const auto Platform : Platforms) {
1155+
auto SearchRes = std::find_if(std::begin(Platform->Devices),
1156+
std::end(Platform->Devices), IsDevice);
11571157
if (SearchRes != end(Platform->Devices)) {
11581158
*phDevice = static_cast<ur_device_handle_t>((*SearchRes).get());
11591159
return UR_RESULT_SUCCESS;

source/adapters/cuda/event.hpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ struct ur_event_handle_t_ {
8383
static ur_event_handle_t
8484
makeNative(ur_command_t Type, ur_queue_handle_t Queue, CUstream Stream,
8585
uint32_t StreamToken = std::numeric_limits<uint32_t>::max()) {
86-
bool ProfilingEnabled = Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE;
86+
const bool ProfilingEnabled =
87+
Queue->URFlags & UR_QUEUE_FLAG_PROFILING_ENABLE;
8788
native_type EvEnd = nullptr, EvQueued = nullptr, EvStart = nullptr;
8889
UR_CHECK_ERROR(cuEventCreate(
8990
&EvEnd, ProfilingEnabled ? CU_EVENT_DEFAULT : CU_EVENT_DISABLE_TIMING));

source/adapters/cuda/program.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ ur_result_t ur_program_handle_t_::buildProgram(const char *BuildOptions) {
137137

138138
if (!this->BuildOptions.empty()) {
139139
unsigned int MaxRegs;
140-
bool Valid = getMaxRegistersJitOptionValue(this->BuildOptions, MaxRegs);
140+
const bool Valid =
141+
getMaxRegistersJitOptionValue(this->BuildOptions, MaxRegs);
141142
if (Valid) {
142143
Options.push_back(CU_JIT_MAX_REGISTERS);
143144
OptionVals.push_back(reinterpret_cast<void *>(MaxRegs));

0 commit comments

Comments
 (0)