Skip to content

Commit 2b9b18d

Browse files
authored
Address NVCC warning #20012-D (#528)
1 parent d186901 commit 2b9b18d

File tree

5 files changed

+11
-9
lines changed

5 files changed

+11
-9
lines changed

include/mscclpp/concurrency_device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ namespace mscclpp {
1515
struct DeviceSyncer {
1616
public:
1717
/// Construct a new DeviceSyncer object.
18-
DeviceSyncer() = default;
18+
MSCCLPP_INLINE DeviceSyncer() = default;
1919

2020
/// Destroy the DeviceSyncer object.
21-
~DeviceSyncer() = default;
21+
MSCCLPP_INLINE ~DeviceSyncer() = default;
2222

2323
#if defined(MSCCLPP_DEVICE_COMPILE)
2424
/// Synchronize all threads inside a kernel. Guarantee that all previous work of all threads in cooperating blocks is

include/mscclpp/device.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#if (defined(__NVCC__) || defined(__HIP_PLATFORM_AMD__))
1212

1313
#define MSCCLPP_DEVICE_COMPILE
14+
#define MSCCLPP_INLINE __forceinline__
1415
#define MSCCLPP_DEVICE_INLINE __forceinline__ __device__
1516
#define MSCCLPP_HOST_DEVICE_INLINE __forceinline__ __host__ __device__
1617
#if defined(__HIP_PLATFORM_AMD__)
@@ -22,6 +23,7 @@
2223
#else // !(defined(__NVCC__) || defined(__HIP_PLATFORM_AMD__))
2324

2425
#define MSCCLPP_HOST_COMPILE
26+
#define MSCCLPP_INLINE inline
2527
#define MSCCLPP_HOST_DEVICE_INLINE inline
2628

2729
#endif // !(defined(__NVCC__) || defined(__HIP_PLATFORM_AMD__))

include/mscclpp/memory_channel_device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ namespace mscclpp {
1515
struct BaseMemoryChannelDeviceHandle {
1616
MemoryDevice2DeviceSemaphoreDeviceHandle semaphore_;
1717

18-
MSCCLPP_HOST_DEVICE_INLINE BaseMemoryChannelDeviceHandle() = default;
18+
MSCCLPP_INLINE BaseMemoryChannelDeviceHandle() = default;
1919

2020
MSCCLPP_HOST_DEVICE_INLINE BaseMemoryChannelDeviceHandle(MemoryDevice2DeviceSemaphoreDeviceHandle semaphore)
2121
: semaphore_(semaphore) {}
@@ -65,7 +65,7 @@ struct MemoryChannelDeviceHandle : public BaseMemoryChannelDeviceHandle {
6565
void* src_;
6666
void* packetBuffer_;
6767

68-
MSCCLPP_HOST_DEVICE_INLINE MemoryChannelDeviceHandle() = default;
68+
MSCCLPP_INLINE MemoryChannelDeviceHandle() = default;
6969

7070
MSCCLPP_HOST_DEVICE_INLINE MemoryChannelDeviceHandle(MemoryDevice2DeviceSemaphoreDeviceHandle semaphore, void* dst,
7171
void* src, void* packetBuffer)

include/mscclpp/packet_device.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ union alignas(16) LL16Packet {
2929
#if defined(MSCCLPP_DEVICE_COMPILE)
3030
ulonglong2 raw_;
3131

32-
MSCCLPP_DEVICE_INLINE LL16Packet() = default;
32+
MSCCLPP_INLINE LL16Packet() = default;
3333

3434
MSCCLPP_DEVICE_INLINE LL16Packet(uint2 val, uint32_t flag) : data1(val.x), flag1(flag), data2(val.y), flag2(flag) {}
3535

@@ -107,7 +107,7 @@ union alignas(8) LL8Packet {
107107
using Payload = uint32_t;
108108
#if defined(MSCCLPP_DEVICE_COMPILE)
109109

110-
MSCCLPP_DEVICE_INLINE LL8Packet() = default;
110+
MSCCLPP_INLINE LL8Packet() = default;
111111

112112
MSCCLPP_DEVICE_INLINE LL8Packet(uint32_t val, uint32_t flag) : data(val), flag(flag) {}
113113

include/mscclpp/port_channel_device.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ union ChannelTrigger {
4949

5050
#if defined(MSCCLPP_DEVICE_COMPILE)
5151
/// Default constructor.
52-
MSCCLPP_DEVICE_INLINE ChannelTrigger() = default;
52+
MSCCLPP_INLINE ChannelTrigger() = default;
5353

5454
/// Copy constructor.
5555
MSCCLPP_DEVICE_INLINE ChannelTrigger(ProxyTrigger value) : value(value) {}
@@ -92,7 +92,7 @@ struct BasePortChannelDeviceHandle {
9292
// can produce for and the sole proxy thread consumes it.
9393
FifoDeviceHandle fifo_;
9494

95-
MSCCLPP_HOST_DEVICE_INLINE BasePortChannelDeviceHandle() = default;
95+
MSCCLPP_INLINE BasePortChannelDeviceHandle() = default;
9696

9797
MSCCLPP_HOST_DEVICE_INLINE BasePortChannelDeviceHandle(SemaphoreId semaphoreId,
9898
Host2DeviceSemaphoreDeviceHandle semaphore,
@@ -190,7 +190,7 @@ struct PortChannelDeviceHandle : public BasePortChannelDeviceHandle {
190190
MemoryId dst_;
191191
MemoryId src_;
192192

193-
MSCCLPP_HOST_DEVICE_INLINE PortChannelDeviceHandle() = default;
193+
MSCCLPP_INLINE PortChannelDeviceHandle() = default;
194194

195195
MSCCLPP_HOST_DEVICE_INLINE PortChannelDeviceHandle(SemaphoreId semaphoreId,
196196
Host2DeviceSemaphoreDeviceHandle semaphore, FifoDeviceHandle fifo,

0 commit comments

Comments
 (0)