Migrate model class to Tensor

This commit is contained in:
2025-11-22 22:40:38 +01:00
parent ca44ea4436
commit 51bcee01ab
11 changed files with 207 additions and 254 deletions

View File

@@ -1,8 +1,29 @@
#pragma once
#include <cstdio>
#include "backend.hpp"
#include "tensor.hpp"
#ifndef BLOCK_SIZE
#define BLOCK_SIZE 128
#endif // BLOCK_SIZE
/**
* @brief CUDA error checking macro
*
*/
#define CUDA_CHECK(call) \
do { \
cudaError_t result = call; \
if (result != cudaSuccess) { \
fprintf(stderr, "CUDA error at %s:%d code=%d(%s) \"%s\" \n", \
__FILE__, __LINE__, static_cast<unsigned int>(result), \
cudaGetErrorString(result), #call); \
exit(EXIT_FAILURE); \
} \
} while (0)
namespace CUDANet::Backend {
class CUDA : public Backend {