Files
rocm-systems/test/common/StandaloneUtils.hpp
T

56 lines
2.0 KiB
C++
Raw Normal View History

2023-08-25 16:26:45 -06:00
#ifndef STANDALONE_UTILS_H
#define STANDALONE_UTILS_H
2024-02-12 17:56:15 -07:00
#include <cstdio>
#include <vector>
#include <string>
#include <rccl/rccl.h>
2024-02-12 17:56:15 -07:00
2023-08-25 16:26:45 -06:00
#define HIPCALL(cmd) \
do { \
hipError_t error = (cmd); \
if (error != hipSuccess) \
{ \
printf("Encountered HIP error (%s) at line %d in file %s\n", \
hipGetErrorString(error), __LINE__, __FILE__); \
exit(-1); \
} \
} while (0)
#define NCCLCHECK(cmd) do { \
ncclResult_t res = cmd; \
if (res != ncclSuccess) { \
printf("NCCL failure %s:%d '%s'\n", \
__FILE__,__LINE__,ncclGetErrorString(res)); \
} \
} while(0)
2024-07-19 08:15:59 -07:00
// should be 112, temp fix to make CI pass
#define MAX_STACK_SIZE 480
2024-02-12 17:56:15 -07:00
#ifdef ENABLE_LL128
#define MAX_STACK_SIZE_gfx90a 360
2024-02-12 17:56:15 -07:00
#else
#define MAX_STACK_SIZE_gfx90a MAX_STACK_SIZE
#endif
namespace RcclUnitTesting
{
struct KernelInfo {
std::string name;
int privateSegmentFixedSize = 0;
};
2024-02-12 17:56:15 -07:00
struct ArchInfo {
std::string archName;
std::vector<KernelInfo> kernels;
};
2024-02-12 17:56:15 -07:00
std::string executeCommand(const char* cmd);
2024-02-12 17:56:15 -07:00
std::vector<std::string> splitString(const std::string& str, char delimiter);
2024-02-12 17:56:15 -07:00
ArchInfo parseMetadata(const std::vector<std::string>& list);
2024-02-12 17:56:15 -07:00
}
#endif