mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 17:54:27 +00:00
16 lines
438 B
Plaintext
16 lines
438 B
Plaintext
#include <gtest/gtest.h>
|
|
|
|
#include "input.cuh"
|
|
#include "cuda_helper.cuh"
|
|
|
|
|
|
TEST(InputLayerTest, Init) {
|
|
std::vector<float> input = {0.573f, 0.619f, 0.732f, 0.055f, 0.243f, 0.316f};
|
|
Layers::Input inputLayer(6);
|
|
float* d_output = inputLayer.forward(input.data());
|
|
|
|
std::vector<float> output(6);
|
|
CUDA_CHECK(cudaMemcpy(output.data(), d_output, sizeof(float) * 6, cudaMemcpyDeviceToHost));
|
|
EXPECT_EQ(input, output);
|
|
|
|
} |