Files
triton/lib/model/convert.hpp
Philippe Tillet cf5028d55b Squashed feature branch:
* Added CUDA support
 * Performance improvements
 * API improvements
 * Added "depth" parameter to GEMM
 * Android cross-compilation
2015-04-29 15:52:21 -04:00

34 lines
634 B
C++

#ifndef ISAAC_MODEL_TOOLS_HPP
#define ISAAC_MODEL_TOOLS_HPP
#include <vector>
#include "rapidjson/document.h"
namespace isaac
{
namespace tools
{
template<class T>
std::vector<T> to_int_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetInt();
return res;
}
template<class T>
std::vector<T> to_float_array(rapidjson::Value const & a)
{
size_t N = a.Size();
std::vector<T> res(N);
for(size_t i = 0 ; i < N ; ++i) res[i] = a[i].GetDouble();
return res;
}
}
}
#endif