diff --git a/src/expression_graph.cu b/src/expression_graph.cu index cc0d9fb9..00f93621 100644 --- a/src/expression_graph.cu +++ b/src/expression_graph.cu @@ -39,34 +39,11 @@ std::string Expr::Debug() const } /////////////////////////////////////////////////////// -#include "tensor_operators.h" - -void temp() -{ - std::vector hVec({1,2, 4,3, 7,9, 7,3}); - thrust::device_vector dVec(8); - thrust::copy(hVec.begin(), hVec.end(), dVec.begin()); - float *data = thrust::raw_pointer_cast(dVec.data()); - - gSoftMax<<<4, 2, sizeof(float)>>>(data, 4, 2); - - std::vector hVec2(8); - thrust::copy(dVec.begin(), dVec.end(), hVec2.begin()); - cerr << "hVec2="; - for (size_t i = 0; i < hVec.size(); ++i) { - cerr << hVec2[i] << " "; - } - cerr << endl; -} - ExpressionGraph::ExpressionGraph(int cudaDevice) : stack_(new ChainableStack) { std::srand (time(NULL)); cudaSetDevice(0); - - temp(); - exit(0); } } diff --git a/src/test.cu b/src/test.cu index 8d7073f4..1608a7dd 100644 --- a/src/test.cu +++ b/src/test.cu @@ -3,6 +3,29 @@ #include "mnist.h" #include "vocab.h" +#include "tensor_operators.h" + +/////////////////////////////////////////////////////// +void temp() +{ + std::vector hVec({1,2, 4,3, 7,9, 7,3}); + thrust::device_vector dVec(8); + thrust::copy(hVec.begin(), hVec.end(), dVec.begin()); + float *data = thrust::raw_pointer_cast(dVec.data()); + + gSoftMax<<<4, 2, sizeof(float)>>>(data, 4, 2); + + std::vector hVec2(8); + thrust::copy(dVec.begin(), dVec.end(), hVec2.begin()); + cerr << "hVec2="; + for (size_t i = 0; i < hVec.size(); ++i) { + cerr << hVec2[i] << " "; + } + cerr << endl; + exit(0); +} + +/////////////////////////////////////////////////////// int main(int argc, char** argv) { using namespace std;