1111#include < ucs/sys/device_code.h>
1212#include < ucs/type/status.h>
1313
14- #define UCT_ROCM_IPC_IS_ALIGNED_POW2 (_n, _p ) (!((_n) & ((_p)-1 )))
1514
1615/* Dynamically detect wavefront size using compiler builtin. */
1716#if __has_builtin(__builtin_amdgcn_wavefrontsize)
@@ -130,8 +129,8 @@ uct_rocm_ipc_copy_level<UCS_DEVICE_LEVEL_WARP>(void *dst, const void *src,
130129 auto d1 = reinterpret_cast <char *>(dst);
131130
132131 /* 16B-aligned fast path using vec4 */
133- if (UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec4)) &&
134- UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec4))) {
132+ if (UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec4)) &&
133+ UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec4))) {
135134 const vec4 *s4 = reinterpret_cast <const vec4*>(s1);
136135 vec4 *d4 = reinterpret_cast <vec4*>(d1);
137136 size_t n4 = len / sizeof (vec4);
@@ -151,8 +150,8 @@ uct_rocm_ipc_copy_level<UCS_DEVICE_LEVEL_WARP>(void *dst, const void *src,
151150 }
152151
153152 /* 8B-aligned fast path using vec2 */
154- if (UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec2)) &&
155- UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec2))) {
153+ if (UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec2)) &&
154+ UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec2))) {
156155 const vec2 *s2 = reinterpret_cast <const vec2*>(s1);
157156 vec2 *d2 = reinterpret_cast <vec2*>(d1);
158157 size_t n2 = len / sizeof (vec2);
@@ -187,8 +186,8 @@ uct_rocm_ipc_copy_level<UCS_DEVICE_LEVEL_BLOCK>(void *dst, const void *src,
187186 auto s1 = reinterpret_cast <const char *>(src);
188187 auto d1 = reinterpret_cast <char *>(dst);
189188
190- if (UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec4)) &&
191- UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec4))) {
189+ if (UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec4)) &&
190+ UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec4))) {
192191 const vec4 *s4 = reinterpret_cast <const vec4*>(s1);
193192 vec4 *d4 = reinterpret_cast <vec4*>(d1);
194193 size_t num_lines = len / sizeof (vec4);
@@ -208,8 +207,8 @@ uct_rocm_ipc_copy_level<UCS_DEVICE_LEVEL_BLOCK>(void *dst, const void *src,
208207 }
209208
210209 /* 8B-aligned fast path using vec2 */
211- if (UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec2)) &&
212- UCT_ROCM_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec2))) {
210+ if (UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )s1, sizeof (vec2)) &&
211+ UCT_IPC_IS_ALIGNED_POW2 ((intptr_t )d1, sizeof (vec2))) {
213212 const vec2 *s2 = reinterpret_cast <const vec2*>(s1);
214213 vec2 *d2 = reinterpret_cast <vec2*>(d1);
215214 size_t num_lines = len / sizeof (vec2);
0 commit comments