Navigation Menu

Skip to content

Commit

Permalink
float32
Browse files Browse the repository at this point in the history
  • Loading branch information
OXPHOS authored and vigsterkr committed Aug 22, 2016
1 parent d291a7e commit dad5a09
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/BaseVector.h
Expand Up @@ -12,7 +12,7 @@ template <class T>
struct BaseVector
{
BaseVector(){}
const virtual bool onGPU() = 0;
virtual bool onGPU() = 0 ;

index_t vlen;
};
Expand Down
1 change: 1 addition & 0 deletions src/shogun/mathematics/linalgrefactor/CPUBackend.cpp
Expand Up @@ -12,4 +12,5 @@ template <typename T> T CPUBackend::dot(const CPUVector<T> &a, const CPUVector<T
}

template int32_t CPUBackend::dot<int32_t>(const CPUVector<int32_t> &a, const CPUVector<int32_t> &b);
template float32_t CPUBackend::dot<float32_t>(const CPUVector<float32_t> &a, const CPUVector<float32_t> &b);
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/CPUVector.cpp
Expand Up @@ -15,5 +15,5 @@ CPUVector<T>::CPUVector(const CPUVector<T> &vector)
: CPUptr(vector.CPUptr), vlen(vector.vlen) { }

template struct CPUVector<int32_t>;

template struct CPUVector<float32_t>;
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/CPUVector.h
Expand Up @@ -20,7 +20,7 @@ struct CPUVector : public BaseVector<T>

CPUVector(const CPUVector<T> &vector);

const bool onGPU() { return false; }
bool onGPU() { return false; }
};

}
Expand Down
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/GPUArray.cpp
Expand Up @@ -42,5 +42,5 @@ GPU_Vector<T>::GPUArray::GPUArray(const SGVector<T> &vector)
#endif

template struct GPU_Vector<int32_t>;

template struct GPU_Vector<float32_t>;
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/GPUBackend.cpp
Expand Up @@ -25,5 +25,5 @@ template <typename T> T GPUBackend::dot(const GPU_Vector<T> &a, const GPU_Vector
}

template int32_t GPUBackend::dot<int32_t>(const GPU_Vector<int32_t> &a, const GPU_Vector<int32_t> &b);

template float32_t GPUBackend::dot<float32_t>(const GPU_Vector<float32_t> &a, const GPU_Vector<float32_t> &b);
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/GPU_Vector.cpp
Expand Up @@ -59,5 +59,5 @@ GPU_Vector<T>& GPU_Vector<T>::operator=(const GPU_Vector<T> &other)
template <class T> GPU_Vector<T>::~GPU_Vector() { }

template struct GPU_Vector<int32_t>;

template struct GPU_Vector<float32_t>;
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/GPU_Vector.h
Expand Up @@ -32,7 +32,7 @@ struct GPU_Vector : public BaseVector<T>

GPU_Vector<T>& operator=(const GPU_Vector<T> &other);

const bool onGPU() { return true; }
bool onGPU() { return true; }

public:
/** Vector length */
Expand Down
6 changes: 3 additions & 3 deletions src/shogun/mathematics/linalgrefactor/linalgRefactor.cpp
Expand Up @@ -33,7 +33,7 @@ GPUBackend* Linalg::get_gpu_backend()
}

template <class T>
T Linalg::dot(BaseVector<T> const * const a, BaseVector<T> const * const b)
T Linalg::dot(BaseVector<T> *a, BaseVector<T> *b)
{
if (a->onGPU() && b->onGPU())
{
Expand Down Expand Up @@ -72,6 +72,6 @@ bool Linalg::hasGPUBackend()
return m_gpubackend != nullptr;
}

template int32_t Linalg::dot<int32_t>(BaseVector<int32_t> const * const a, BaseVector<int32_t> const * const b);

template int32_t Linalg::dot<int32_t>(BaseVector<int32_t> *a, BaseVector<int32_t> *b);
template float32_t Linalg::dot<float32_t>(BaseVector<float32_t> *a, BaseVector<float32_t> *b);
}
2 changes: 1 addition & 1 deletion src/shogun/mathematics/linalgrefactor/linalgRefactor.h
Expand Up @@ -73,7 +73,7 @@ class Linalg
GPUBackend* get_gpu_backend();

template <class T>
T dot(BaseVector<T> const * const a, BaseVector<T> const * const b);
T dot(BaseVector<T> *a, BaseVector<T> *b);

bool hasGPUBackend();

Expand Down

0 comments on commit dad5a09

Please sign in to comment.