FasTensor  1.0.0
Transform Supercomputing for AI
Macros
ft_endpoint.cpp File Reference
#include "ft_endpoint.h"

Macros

#define VOID2UNION_HELPER(TARGET_TYPE, EMPLACE_INDEX)
 
#define UNION2VOID_HELPER(TARGET_TYPE, EMPLACE_INDEX)
 

Macro Definition Documentation

◆ UNION2VOID_HELPER

#define UNION2VOID_HELPER (   TARGET_TYPE,
  EMPLACE_INDEX 
)
Value:
{ \
std::vector<TARGET_TYPE> temp_pointer_of_type; \
temp_pointer_of_type.resize(n_elements); \
for (int i = 0; i < n_elements; i++) \
{ \
temp_pointer_of_type[i] = std::get<EMPLACE_INDEX>(data_vector_in_union_type[i]); \
} \
return static_cast<void *>(temp_pointer_of_type.data()); \
}

◆ VOID2UNION_HELPER

#define VOID2UNION_HELPER (   TARGET_TYPE,
  EMPLACE_INDEX 
)
Value:
{ \
TARGET_TYPE *temp_pointer_of_type = (TARGET_TYPE *)data_vector_in_void; \
for (int i = 0; i < n_elements; i++) \
{ \
data_vector_in_union_type[i].emplace<EMPLACE_INDEX>(temp_pointer_of_type[i]); \
} \
}