move to gpu

This commit is contained in:
Hieu Hoang 2016-09-02 23:27:11 +01:00
parent 2316a16019
commit ba6a7c3ac2
15 changed files with 75 additions and 25 deletions

View File

@ -50,11 +50,6 @@
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>mblas</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/src/mblas</locationURI>
</link>
<link>
<name>yaml-cpp</name>
<type>2</type>
@ -210,6 +205,16 @@
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/common/vocab.h</locationURI>
</link>
<link>
<name>gpu/dl4mt</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>gpu/mblas</name>
<type>2</type>
<locationURI>virtual:/virtual</locationURI>
</link>
<link>
<name>gpu/npz_converter.cu</name>
<type>1</type>
@ -580,6 +585,51 @@
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/yaml-cpp/yaml.h</locationURI>
</link>
<link>
<name>gpu/dl4mt/decoder.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/decoder.h</locationURI>
</link>
<link>
<name>gpu/dl4mt/dl4mt.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/dl4mt.h</locationURI>
</link>
<link>
<name>gpu/dl4mt/encoder.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/encoder.h</locationURI>
</link>
<link>
<name>gpu/dl4mt/gru.cu</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/gru.cu</locationURI>
</link>
<link>
<name>gpu/dl4mt/gru.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/gru.h</locationURI>
</link>
<link>
<name>gpu/dl4mt/model.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/dl4mt/model.h</locationURI>
</link>
<link>
<name>gpu/mblas/matrix.cu</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/mblas/matrix.cu</locationURI>
</link>
<link>
<name>gpu/mblas/matrix.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/mblas/matrix.h</locationURI>
</link>
<link>
<name>gpu/mblas/thrust_functions.h</name>
<type>1</type>
<locationURI>PARENT-1-PROJECT_LOC/src/gpu/mblas/thrust_functions.h</locationURI>
</link>
<link>
<name>yaml-cpp/contrib/anchordict.h</name>
<type>1</type>

View File

@ -38,8 +38,8 @@ cuda_add_executable(
common/scorer.cpp
common/search.cpp
common/sentence.cpp
mblas/matrix.cu
dl4mt/gru.cu
gpu/mblas/matrix.cu
gpu/dl4mt/gru.cu
$<TARGET_OBJECTS:libamun>
$<TARGET_OBJECTS:libcommon>
$<TARGET_OBJECTS:libyaml-cpp>

View File

@ -5,7 +5,7 @@
#include "types.h"
#include "file_stream.h"
#include "scorer.h"
#include "matrix.h"
#include "gpu/mblas/matrix.h"
#include "loader.h"
typedef std::vector<Word> SrcTrgMap;

View File

@ -1,6 +1,6 @@
#include "encoder_decoder.h"
#include "matrix.h"
#include "god.h"
#include "gpu/mblas/matrix.h"
#include "common/god.h"
mblas::Matrix& EncoderDecoderState::GetStates() {
return states_;

View File

@ -5,7 +5,7 @@
#include "scorer.h"
#include "loader.h"
#include "dl4mt.h"
#include "gpu/dl4mt/dl4mt.h"
#include "threadpool.h"

View File

@ -1,5 +0,0 @@
#pragma once
#include "dl4mt/model.h"
#include "dl4mt/encoder.h"
#include "dl4mt/decoder.h"

View File

@ -1,8 +1,8 @@
#pragma once
#include "mblas/matrix.h"
#include "dl4mt/model.h"
#include "dl4mt/gru.h"
#include "../mblas/matrix.h"
#include "model.h"
#include "gru.h"
class Decoder {
private:

5
src/gpu/dl4mt/dl4mt.h Normal file
View File

@ -0,0 +1,5 @@
#pragma once
#include "model.h"
#include "encoder.h"
#include "decoder.h"

View File

@ -1,8 +1,8 @@
#pragma once
#include "mblas/matrix.h"
#include "dl4mt/model.h"
#include "dl4mt/gru.h"
#include "../mblas/matrix.h"
#include "model.h"
#include "gru.h"
class Encoder {
private:

View File

@ -1,6 +1,6 @@
#pragma once
#include "mblas/matrix.h"
#include "../mblas/matrix.h"
template <class Weights>
class SlowGRU {
@ -145,4 +145,4 @@ class FastGRU {
};
template<class T>
using GRU = FastGRU<T>;
using GRU = FastGRU<T>;

View File

@ -3,7 +3,7 @@
#include <map>
#include <string>
#include "mblas/matrix.h"
#include "../mblas/matrix.h"
#include "gpu/npz_converter.h"
struct Weights {