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

61 satır
1.5 KiB
C++
Ham Normal Görünüm Geçmiş

2018-09-24 16:06:59 -07:00
/*************************************************************************
2020-05-12 14:40:18 -07:00
* Copyright (c) 2015-2020, NVIDIA CORPORATION. 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:
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"
2020-09-04 14:35:05 -07:00
#include "nvtx.h"
2019-11-19 14:57:39 -08:00
2018-09-24 16:06:59 -07:00
#endif // end include guard