mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-12-23 14:54:28 +00:00
Migrate model class to Tensor
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user