Skip to content

Instantly share code, notes, and snippets.

@OXPHOS
Last active May 31, 2016 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OXPHOS/a70af5c8945befc8915d143e5c5d4b8e to your computer and use it in GitHub Desktop.
Save OXPHOS/a70af5c8945befc8915d143e5c5d4b8e to your computer and use it in GitHub Desktop.
g++ -c -std=c++11 -I. main.cpp -lshogun
#include <linalg.h>
#include <shogun/lib/SGVector.h>
#include <memory>
namespace shogun
{
template <class T>
struct GPUVector<T>::GPUArray
{
GPUArray(){}
};
template <class T>
GPUVector<T>::GPUVector(int32_t a) : gpuarray(std::unique_ptr<GPUArray>(new GPUVector<T>::GPUArray()))
{
}
template struct GPUVector<int32_t>;
template struct GPUVector<float64_t>;
}
#ifndef LINALG_H_
#define LINALG_H_
#include <memory>
namespace shogun
{
template <typename T> class SGVector;
template <typename T>
struct BaseVector
{
};
template <class T>
struct GPUVector : public BaseVector<T>
{
GPUVector(int32_t a);
private:
struct GPUArray;
std::unique_ptr<GPUArray> gpuarray;
};
}
#endif
#include <linalg.h>
using namespace shogun;
int main()
{
int b = 5;
GPUVector<int32_t> a_GPU(b);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment