Add SIMD flags for runtime check#800
Merged
gangliao merged 3 commits intoPaddlePaddle:developfrom Dec 9, 2016
Merged
Conversation
gangliao
commented
Dec 9, 2016
| using namespace paddle; // NOLINT | ||
|
|
||
| TEST(SIMDFlags, gccTest) { | ||
| #if (defined(__GNUC__) || defined(__GNUG__)) && !(defined(__clang__)) |
Contributor
Author
There was a problem hiding this comment.
GCC可以用__builtin_cpu_supports对比一下
Collaborator
There was a problem hiding this comment.
也许我们应该找几个奇怪的CPU试一下。。不知道我们是不是AMD CPU的机器。
2 tasks
reyoung
requested changes
Dec 9, 2016
paddle/utils/CpuId.h
Outdated
|
|
||
| static SIMDFlags* instance(); | ||
|
|
||
| inline bool isSSE() { return simd_flags_ & SIMD_SSE; } |
Collaborator
There was a problem hiding this comment.
inline bool isSSE() const;
下同
| using namespace paddle; // NOLINT | ||
|
|
||
| TEST(SIMDFlags, gccTest) { | ||
| #if (defined(__GNUC__) || defined(__GNUG__)) && !(defined(__clang__)) |
Collaborator
There was a problem hiding this comment.
也许我们应该找几个奇怪的CPU试一下。。不知道我们是不是AMD CPU的机器。
reyoung
requested changes
Dec 9, 2016
paddle/utils/CpuId.cpp
Outdated
| namespace paddle { | ||
|
|
||
| /// init simd instance | ||
| static InitFunction __init_simd_flags( |
Collaborator
There was a problem hiding this comment.
另外,感觉起来,这里Lazy的Init也无所谓,不一定非要在main函数之前init吧。
gangliao
commented
Dec 9, 2016
| #if (defined(__GNUC__) || defined(__GNUG__)) && !(defined(__clang__)) | ||
| CHECK(__builtin_cpu_supports("sse") == HAS_SSE); | ||
| CHECK(__builtin_cpu_supports("sse2") == HAS_SSE2); | ||
| CHECK(__builtin_cpu_supports("sse3") == HAS_SSE3); |
Contributor
Author
There was a problem hiding this comment.
这里写错了。__builtin_cpu_supports返回的值是positive number, 不一定是1或者true
hedaoyuan
reviewed
Dec 9, 2016
|
|
||
| #pragma once | ||
|
|
||
| #include <iostream> |
Contributor
Author
There was a problem hiding this comment.
之前还写了个os<<重载函数,删了之后,忘了删头文件了。
|
|
||
| SIMDFlags(); | ||
|
|
||
| static SIMDFlags* instance(); |
| #ifdef _WIN32 | ||
|
|
||
| /// for MSVC | ||
| #define CPUID(info, x) __cpuidex(info, x, 0) |
zhhsplendid
pushed a commit
to zhhsplendid/Paddle
that referenced
this pull request
Sep 25, 2019
gglin001
added a commit
to graphcore/Paddle-fork
that referenced
this pull request
Jun 20, 2022
* add argmin and arsort ops
qili93
pushed a commit
that referenced
this pull request
Jun 21, 2022
sneaxiy
pushed a commit
to sneaxiy/Paddle
that referenced
this pull request
Jun 27, 2022
* add argmin and argsort ops (PaddlePaddle#800) * add argmin and arsort ops * Add dot bmm ops (PaddlePaddle#803) * add bmm * add dot op * clean CreateConst * clean CreateCast * add activation ops (PaddlePaddle#808) * add activation ops * fix 1function-redefined error
yaozhixin
pushed a commit
to graphcore/Paddle-fork
that referenced
this pull request
Jul 1, 2022
* add argmin and arsort ops
lizexu123
pushed a commit
to lizexu123/Paddle
that referenced
this pull request
Feb 23, 2024
WAYKEN-TSE
pushed a commit
to WAYKEN-TSE/Paddle
that referenced
this pull request
Dec 6, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.