20 rivejä
502 B
C
20 rivejä
502 B
C
|
|
/*************************************************************************
|
||
|
|
* Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved.
|
||
|
|
*
|
||
|
|
* See LICENSE.txt for license information
|
||
|
|
************************************************************************/
|
||
|
|
|
||
|
|
#ifndef NCCL_ALIGN_H_
|
||
|
|
#define NCCL_ALIGN_H_
|
||
|
|
|
||
|
|
#define DIVUP(x, y) \
|
||
|
|
(((x)+(y)-1)/(y))
|
||
|
|
|
||
|
|
#define ROUNDUP(x, y) \
|
||
|
|
(DIVUP((x), (y))*(y))
|
||
|
|
|
||
|
|
#define ALIGN_SIZE(size, align) \
|
||
|
|
size = ((size + (align) - 1) / (align)) * (align);
|
||
|
|
|
||
|
|
#endif
|