Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Bitmain Sophon Saber Ops Implementation #151

Merged
merged 49 commits into from
Jun 28, 2018

Conversation

guangzhixie
Copy link

No description provided.

@guangzhixie guangzhixie changed the title BM Ops Implementation Bitmain Sophon Saber Ops Implementation Jun 27, 2018
@@ -37,17 +37,17 @@ namespace saber{

typedef TargetWrapper<BM, __device_target> BM_API;

//TODO: check exception
//static bm_handle_t handle = get_bm_handle();
// Init handle only once in the lifetime
static bm_handle_t handle;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

线程安全嘛?还是说目前HW只支持single thread?


#ifdef USE_BM
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这样问题,要用模板特化。而不是在原始代码上加宏来控制。这样如果同时打开CMAKE里面的USE_CPU USE_BM可以保证执行正确嘛?

namespace anakin {
namespace saber {

#ifdef USE_BM
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

默认参数,可以在使用时显示传递。不要用宏来控制定义

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed as suggested

@LittleMaer LittleMaer merged commit 22a8b32 into PaddlePaddle:bitmain Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants