Skip to content

Commit

Permalink
add andoid compilation support
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniil Efremov committed Feb 1, 2017
1 parent 1dc780b commit e7f4160
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions include/caffe/android_patch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// Created by daniil on 1/11/17.
//

#ifndef CLBLAST_ANDROID_PATCH_H
#define CLBLAST_ANDROID_PATCH_H

#include <string>
#include <sstream>
#include <cstdio>
#include <cstdlib>
namespace std {
template<typename T>
std::string to_string(T value) {
//create an output string stream
std::ostringstream os;

//throw the value into the string stream
os << value;

//convert the string stream into a string and return
return os.str();
}

inline double stod(string value) {
return strtod (value.c_str(), NULL);
}

inline int stoi(string value) {
return strtol (value.c_str(),NULL,0);
}
}
#endif //CLBLAST_ANDROID_PATCH_H


1 change: 1 addition & 0 deletions include/caffe/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <utility> // pair
#include <vector>

#include "android_patch.h" // std::string
#include "caffe/definitions.hpp"
#include "caffe/greentea/greentea.hpp"

Expand Down

0 comments on commit e7f4160

Please sign in to comment.