[llvm] [OFFLOAD] Replace C-style casts with C++ style casts in obtainInfoImpl (PR #185023)
Ćukasz Plewa via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 6 07:19:40 PST 2026
https://github.com/lplewa created https://github.com/llvm/llvm-project/pull/185023
Replace C-style bool casts (bool)TmpInt with C++ functional casts bool(TmpInt)
>From d6db7bda29d16725162931d360604888f37afdc7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Plewa?= <lukasz.plewa at intel.com>
Date: Fri, 6 Mar 2026 15:04:58 +0100
Subject: [PATCH] [OFFLOAD] Replace C-style casts with C++ style casts in
obtainInfoImpl
Replace C-style bool casts (bool)TmpInt with C++ functional casts
bool(TmpInt)
---
offload/plugins-nextgen/cuda/src/rtl.cpp | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/offload/plugins-nextgen/cuda/src/rtl.cpp b/offload/plugins-nextgen/cuda/src/rtl.cpp
index d5ab0b3309c86..c50c70a4456fa 100644
--- a/offload/plugins-nextgen/cuda/src/rtl.cpp
+++ b/offload/plugins-nextgen/cuda/src/rtl.cpp
@@ -1119,7 +1119,7 @@ struct CUDADeviceTy : public GenericDeviceTy {
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_GPU_OVERLAP, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Concurrent Copy and Execution", (bool)TmpInt);
+ Info.add("Concurrent Copy and Execution", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_TOTAL_CONSTANT_MEMORY, TmpInt);
if (Res == CUDA_SUCCESS)
@@ -1185,15 +1185,15 @@ struct CUDADeviceTy : public GenericDeviceTy {
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_KERNEL_EXEC_TIMEOUT, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Execution Timeout", (bool)TmpInt);
+ Info.add("Execution Timeout", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_INTEGRATED, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Integrated Device", (bool)TmpInt);
+ Info.add("Integrated Device", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_CAN_MAP_HOST_MEMORY, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Can Map Host Memory", (bool)TmpInt);
+ Info.add("Can Map Host Memory", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_COMPUTE_MODE, TmpInt);
if (Res == CUDA_SUCCESS) {
@@ -1210,11 +1210,11 @@ struct CUDADeviceTy : public GenericDeviceTy {
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_CONCURRENT_KERNELS, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Concurrent Kernels", (bool)TmpInt);
+ Info.add("Concurrent Kernels", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_ECC_ENABLED, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("ECC Enabled", (bool)TmpInt);
+ Info.add("ECC Enabled", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MEMORY_CLOCK_RATE, TmpInt);
if (Res == CUDA_SUCCESS)
@@ -1240,29 +1240,29 @@ struct CUDADeviceTy : public GenericDeviceTy {
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_UNIFIED_ADDRESSING, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Unified Addressing", (bool)TmpInt);
+ Info.add("Unified Addressing", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MANAGED_MEMORY, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Managed Memory", (bool)TmpInt);
+ Info.add("Managed Memory", bool(TmpInt));
Res =
getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Concurrent Managed Memory", (bool)TmpInt);
+ Info.add("Concurrent Managed Memory", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_COMPUTE_PREEMPTION_SUPPORTED,
TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Preemption Supported", (bool)TmpInt);
+ Info.add("Preemption Supported", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_COOPERATIVE_LAUNCH, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Cooperative Launch", (bool)TmpInt);
+ Info.add("Cooperative Launch", bool(TmpInt));
Res = getDeviceAttrRaw(CU_DEVICE_ATTRIBUTE_MULTI_GPU_BOARD, TmpInt);
if (Res == CUDA_SUCCESS)
- Info.add("Multi-Device Boars", (bool)TmpInt);
+ Info.add("Multi-Device Boars", bool(TmpInt));
Info.add("Compute Capabilities", ComputeCapability.str());
More information about the llvm-commits
mailing list