未验证 提交 972daa46 编写于 作者: zhouweiwei2014's avatar zhouweiwei2014 提交者: GitHub

[BUG] fix windows kernel dispatch of _lzcnt bug (#53728)

上级 3e1fffea
...@@ -78,7 +78,10 @@ std::size_t CountLeadingZeros(uint32_t val) { ...@@ -78,7 +78,10 @@ std::size_t CountLeadingZeros(uint32_t val) {
#if defined(__clang__) || defined(__GNUC__) #if defined(__clang__) || defined(__GNUC__)
return __builtin_clz(val); return __builtin_clz(val);
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
return __lzcnt(val); // windows don't have built-in clz/ctz function
DWORD Index;
_BitScanReverse(&Index, val);
return (uint32_t)Index ^ 31;
#else #else
if (val == 0) { if (val == 0) {
return 32; return 32;
......
...@@ -35,8 +35,6 @@ namespace cub = hipcub; ...@@ -35,8 +35,6 @@ namespace cub = hipcub;
#include "paddle/phi/kernels/funcs/for_range.h" #include "paddle/phi/kernels/funcs/for_range.h"
#include "paddle/phi/kernels/randint_kernel.h" #include "paddle/phi/kernels/randint_kernel.h"
DECLARE_bool(use_curand);
namespace phi { namespace phi {
template <typename keyT, typename dataT> template <typename keyT, typename dataT>
......
...@@ -211,7 +211,7 @@ if "%WITH_SCCACHE%"=="ON" ( ...@@ -211,7 +211,7 @@ if "%WITH_SCCACHE%"=="ON" (
:install_sccache :install_sccache
echo There is not sccache in this PC, will install sccache. echo There is not sccache in this PC, will install sccache.
echo Download package from https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe echo Download package from https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe
%PYTHON_ROOT%\python.exe -c "import wget;wget.download('https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe')" python -c "import wget;wget.download('https://paddle-ci.gz.bcebos.com/window_requirement/sccache.exe')"
xcopy sccache.exe %SCCACHE_ROOT%\ /Y xcopy sccache.exe %SCCACHE_ROOT%\ /Y
del sccache.exe del sccache.exe
goto:eof goto:eof
...@@ -429,7 +429,7 @@ if not exist %THIRD_PARTY_PATH% ( ...@@ -429,7 +429,7 @@ if not exist %THIRD_PARTY_PATH% (
if not exist %THIRD_PARTY_HOME% mkdir "%THIRD_PARTY_HOME%" if not exist %THIRD_PARTY_HOME% mkdir "%THIRD_PARTY_HOME%"
cd /d %THIRD_PARTY_HOME% cd /d %THIRD_PARTY_HOME%
echo Getting third party: downloading ... echo Getting third party: downloading ...
%PYTHON_ROOT%\python.exe -c "import wget;wget.download('https://paddle-windows.bj.bcebos.com/third_party/%sub_dir%/%md5%.tar.gz')" 2>nul python -c "import wget;wget.download('https://paddle-windows.bj.bcebos.com/third_party/%sub_dir%/%md5%.tar.gz')" 2>nul
if !ERRORLEVEL! EQU 0 ( if !ERRORLEVEL! EQU 0 (
echo Getting third party: extracting ... echo Getting third party: extracting ...
tar -xf %md5%.tar.gz tar -xf %md5%.tar.gz
...@@ -572,17 +572,15 @@ if %ERRORLEVEL% NEQ 0 ( ...@@ -572,17 +572,15 @@ if %ERRORLEVEL% NEQ 0 (
) )
if "%UPLOAD_TP_FILE%"=="ON" ( if "%UPLOAD_TP_FILE%"=="ON" (
set BCE_FILE=%cache_dir%\bce-python-sdk-0.8.33\BosClient.py set BCE_FILE=%cache_dir%\bce-python-sdk-new\BosClient.py
echo Uploading third_party: checking bce ... echo Uploading third_party: checking bce ...
if not exist %cache_dir%\bce-python-sdk-0.8.33 ( if not exist %cache_dir%\bce-python-sdk-new (
echo There is no bce in this PC, will install bce. echo There is no bce in this PC, will install bce.
cd /d %cache_dir% cd /d %cache_dir%
echo Download package from https://paddle-windows.bj.bcebos.com/bce-python-sdk-0.8.33.tar.gz echo Download package from https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz
%PYTHON_ROOT%\python.exe -c "import wget;wget.download('https://paddle-windows.bj.bcebos.com/bce-python-sdk-0.8.33.tar.gz')" python -c "import wget;wget.download('https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz')"
%PYTHON_ROOT%\python.exe -c "import shutil;shutil.unpack_archive('bce-python-sdk-0.8.33.tar.gz', extract_dir='./',format='gztar')" python -c "import shutil;shutil.unpack_archive('bos_new.tar.gz', extract_dir='./bce-python-sdk-new',format='gztar')"
cd /d %cache_dir%\bce-python-sdk-0.8.33 python -m pip install bce-python-sdk
%PYTHON_ROOT%\python.exe setup.py install 1>nul
del %cache_dir%\bce-python-sdk-0.8.33.tar.gz
) )
if !errorlevel! EQU 0 ( if !errorlevel! EQU 0 (
cd /d %THIRD_PARTY_HOME% cd /d %THIRD_PARTY_HOME%
...@@ -590,7 +588,7 @@ if "%UPLOAD_TP_FILE%"=="ON" ( ...@@ -590,7 +588,7 @@ if "%UPLOAD_TP_FILE%"=="ON" (
tar -zcf %md5%.tar.gz %md5% tar -zcf %md5%.tar.gz %md5%
if !errorlevel! EQU 0 ( if !errorlevel! EQU 0 (
echo Uploading third_party: uploading ... echo Uploading third_party: uploading ...
%PYTHON_ROOT%\python.exe !BCE_FILE! %md5%.tar.gz paddle-windows/third_party/%sub_dir% 1>nul python !BCE_FILE! %md5%.tar.gz paddle-windows/third_party/%sub_dir% 1>nul
if !errorlevel! EQU 0 ( if !errorlevel! EQU 0 (
echo Upload third party %md5% to bos paddle-windows/third_party/%sub_dir% successfully. echo Upload third party %md5% to bos paddle-windows/third_party/%sub_dir% successfully.
) else ( ) else (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册