Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
迷途归一
Paddle
提交
1918ad87
P
Paddle
项目概览
迷途归一
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1918ad87
编写于
8月 22, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix gpu build error
上级
36e8e725
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
2 addition
and
31 deletion
+2
-31
paddle/operators/math/CMakeLists.txt
paddle/operators/math/CMakeLists.txt
+2
-2
paddle/operators/math/math_function.cc
paddle/operators/math/math_function.cc
+0
-9
paddle/operators/math/math_function.cu
paddle/operators/math/math_function.cu
+0
-13
paddle/operators/math/math_function.h
paddle/operators/math/math_function.h
+0
-5
paddle/platform/device_context_test.cc
paddle/platform/device_context_test.cc
+0
-2
未找到文件。
paddle/operators/math/CMakeLists.txt
浏览文件 @
1918ad87
if
(
WITH_GPU
)
nv_library
(
math_function SRCS math_function.cc math_function.cu DEPS cblas device_context
eigen3
)
nv_library
(
math_function SRCS math_function.cc math_function.cu DEPS cblas device_context
)
else
()
cc_library
(
math_function SRCS math_function.cc DEPS cblas device_context
eigen3
)
cc_library
(
math_function SRCS math_function.cc DEPS cblas device_context
)
endif
()
nv_test
(
math_function_test SRCS math_function_test.cc DEPS math_function tensor
)
paddle/operators/math/math_function.cc
浏览文件 @
1918ad87
...
...
@@ -109,15 +109,6 @@ void matmul<platform::CPUPlace, double>(const framework::Tensor& matrix_a,
matrix_b
.
data
<
double
>
(),
beta
,
matrix_out
->
data
<
double
>
(),
context
);
}
template
<
>
void
Set
<
platform
::
CPUPlace
,
float
>
(
const
int
n
,
const
float
alpha
,
float
*
output
,
platform
::
DeviceContext
*
context
)
{
auto
*
cpu_context
=
reinterpret_cast
<
platform
::
CPUDeviceContext
*>
(
context
);
framework
::
EigenVector
<
float
>::
Type
out
(
output
,
n
);
out
.
device
(
*
(
cpu_context
->
eigen_device
()))
=
out
.
constant
(
float
(
alpha
));
}
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/operators/math/math_function.cu
浏览文件 @
1918ad87
...
...
@@ -12,10 +12,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. */
#include <thrust/device_ptr.h>
#include <thrust/iterator/counting_iterator.h>
#include <thrust/random.h>
#include <thrust/transform.h>
#include "paddle/operators/math/math_function.h"
namespace
paddle
{
...
...
@@ -126,15 +122,6 @@ void matmul<platform::GPUPlace, double>(const framework::Tensor& matrix_a,
matrix_b
.
data
<
double
>
(),
beta
,
matrix_out
->
data
<
double
>
(),
context
);
}
template
<
>
void
Set
<
platform
::
GPUPlace
,
float
>
(
const
int
n
,
const
float
alpha
,
float
*
output
,
platform
::
DeviceContext
*
context
)
{
auto
*
cuda_context
=
reinterpret_cast
<
platform
::
CUDADeviceContext
*>
(
context
);
framework
::
EigenVector
<
float
>::
Type
out
(
output
,
n
);
out
.
device
(
*
(
cuda_context
->
eigen_device
()))
=
out
.
constant
(
float
(
alpha
));
}
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/operators/math/math_function.h
浏览文件 @
1918ad87
...
...
@@ -52,7 +52,6 @@ int LAPACKE_dgetri(int matrix_layout, int n, double* a, int lda,
#include <cmath>
#include "paddle/framework/eigen.h"
#include "paddle/framework/tensor.h"
#include "paddle/platform/device_context.h"
#include "paddle/platform/enforce.h"
...
...
@@ -78,10 +77,6 @@ void matmul(const framework::Tensor& matrix_a, bool trans_a,
framework
::
Tensor
*
matrix_out
,
T
beta
,
platform
::
DeviceContext
*
context
);
template
<
typename
Place
,
typename
T
>
void
Set
(
const
int
n
,
const
T
alpha
,
T
*
output
,
platform
::
DeviceContext
*
context
);
}
// namespace math
}
// namespace operators
}
// namespace paddle
paddle/platform/device_context_test.cc
浏览文件 @
1918ad87
...
...
@@ -43,8 +43,6 @@ TEST(Device, CUDADeviceContext) {
ASSERT_NE
(
nullptr
,
cudnn_handle
);
cublasHandle_t
cublas_handle
=
device_context
->
cublas_handle
();
ASSERT_NE
(
nullptr
,
cublas_handle
);
curandGenerator_t
curand_handle
=
device_context
->
curand_generator
();
ASSERT_NE
(
nullptr
,
curand_handle
);
ASSERT_NE
(
nullptr
,
device_context
->
stream
());
delete
device_context
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录