-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple functions speed up #563
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
vectorFill replaced by std::fill_n dataCopy replaced by std::copy Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Extract common code for simple math primitives. Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
NeoMathEngine/src/CPU/x86/CpuX86.h
Outdated
|
||
sseSize -= 4; | ||
if( vectorSize > 0 ) { | ||
memcpy( dst, src, vectorSize * sizeof( T ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Какая-то непоследовательность. Если std::fill_n, тогда std::copy_n, зачем memcpy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, согласен. copy_n будет лучше смотреться
Signed-off-by: Yury Katkov <[email protected]>
CGenerator& genInst = gens[static_cast< size_t >( P )]; | ||
genInst.lock.lock(); | ||
if( genInst.gen.getSize() == 0 ) { | ||
initPrimitive<P>(); | ||
} | ||
genInst.lock.unlock(); | ||
return genInst.gen.getCode(); | ||
return reinterpret_cast<void*>( const_cast<uint8_t*>( genInst.gen.getCode() ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Хватило бы static_cast
, а reinterpret_cast
- перебор.
Fix PR comment. Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
Signed-off-by: Yury Katkov <[email protected]>
No description provided.