#ifndef MATCOMM_KERNEL_BODY_H_
#define MATCOMM_KERNEL_BODY_H_

#ifdef _CMEM_USE_GPU_
__device__ void MySyncthreads();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetGridDimX();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetGridDimY();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetBlockDimX();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetBlockDimY();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetBlockIdxX();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetBlockIdxY();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetThreadIdxX();
#endif

#ifdef _CMEM_USE_GPU_
__device__ int GetThreadIdxY();
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP32ToFP8_E4M3ArrayKernel(fp8_e4m3 *y, fp32 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP32ToFP8_E5M2ArrayKernel(fp8_e5m2 *y, fp32 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP32ToFP16ArrayKernel(fp16 *y, fp32 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP16ToFP8_E4M3ArrayKernel(fp8_e4m3 *y, fp16 *x, int yBase, int xBase, int dSize);
#endif
#endif


#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP16ToFP8_E5M2ArrayKernel(fp8_e5m2 *y, fp16 *x, int yBase, int xBase, int dSize);
#endif
#endif


#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP16ToFP32ArrayKernel(fp32 *y, fp16 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E4M3ToFP8_E5M2ArrayKernel(fp8_e5m2 *y, fp8_e4m3 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E4M3ToFP16ArrayKernel(fp16 *y, fp8_e4m3 *x, int yBase, int xBase, int dSize);
#endif
#endif


#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E4M3ToFP32ArrayKernel(fp32 *y, fp8_e4m3 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E5M2ToFP8_E4M3ArrayKernel(fp8_e4m3 *y, fp8_e5m2 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E5M2ToFP16ArrayKernel(fp16 *y, fp8_e5m2 *x, int yBase, int xBase, int dSize);
#endif
#endif

#ifdef _CMEM_USE_GPU_
#if (defined(_USE_CUDA_) || defined(_USE_ROCM_))
FUNTYPE void FP8_E5M2ToFP32ArrayKernel(fp32 *y, fp8_e5m2 *x, int yBase, int xBase, int dSize);
#endif
#endif

/*#ifdef _CMEM_USE_GPU_
#ifdef _USE_OPENCL_
void FillCLCharBuffZeroKernel(_GMEM_ fp32 *ibuff, _GMEM_ int *ioffset, _GMEM_ int *idataSize);
#endif
#endif*/

#endif
