Files
rocm-systems/src/include/core.h
T

63 خطوط
1.6 KiB
C++

2018-09-24 16:06:59 -07:00
/*************************************************************************
2021-07-08 14:12:04 -07:00
* Copyright (c) 2015-2021, NVIDIA CORPORATION. All rights reserved.
* Modifications Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
2018-09-24 16:06:59 -07:00
*
* See LICENSE.txt for license information
************************************************************************/
#ifndef NCCL_CORE_H_
#define NCCL_CORE_H_
2019-03-14 19:39:20 -07:00
#include <pthread.h>
2018-09-24 16:06:59 -07:00
#include <unistd.h>
#include <stdlib.h>
2019-11-19 14:57:39 -08:00
#include <stdint.h>
#include <algorithm> // For std::min/std::max
#include "nccl.h"
2018-09-24 16:06:59 -07:00
#ifdef PROFAPI
#define NCCL_API(ret, func, args...) \
__attribute__ ((visibility("default"))) \
__attribute__ ((alias(#func))) \
ret p##func (args); \
extern "C" \
__attribute__ ((visibility("default"))) \
__attribute__ ((weak)) \
ret func(args)
#else
#define NCCL_API(ret, func, args...) \
extern "C" \
__attribute__ ((visibility("default"))) \
ret func(args)
#endif // end PROFAPI
2018-12-13 15:56:12 -08:00
static __inline__ int ncclTypeSize(ncclDataType_t type) {
switch (type) {
case ncclInt8:
case ncclUint8:
return 1;
case ncclFloat16:
2019-11-15 10:39:48 -08:00
case ncclBfloat16:
2018-12-13 15:56:12 -08:00
return 2;
case ncclInt32:
case ncclUint32:
case ncclFloat32:
return 4;
case ncclInt64:
case ncclUint64:
case ncclFloat64:
return 8;
default:
return -1;
}
}
2018-09-24 16:06:59 -07:00
2019-11-19 14:57:39 -08:00
#include "debug.h"
#include "checks.h"
#include "alloc.h"
#include "utils.h"
#include "param.h"
#include "nvtx_stub.h"
2019-11-19 14:57:39 -08:00
2018-09-24 16:06:59 -07:00
#endif // end include guard