未验证 提交 58a478f8 编写于 作者: H houj04 提交者: GitHub

[XPU] update xpu cmake to 0928. (#46437)

* [XPU] update xpu cmake to 0923. test=kunlun

* [XPU] update xpu cmake to 0928. test=kunlun
上级 2f76ddd7
...@@ -10,7 +10,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so") ...@@ -10,7 +10,7 @@ set(XPU_RT_LIB_NAME "libxpurt.so")
if(NOT DEFINED XPU_BASE_URL) if(NOT DEFINED XPU_BASE_URL)
set(XPU_BASE_URL_WITHOUT_DATE set(XPU_BASE_URL_WITHOUT_DATE
"https://baidu-kunlun-product.su.bcebos.com/KL-SDK/klsdk-dev") "https://baidu-kunlun-product.su.bcebos.com/KL-SDK/klsdk-dev")
set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220919") set(XPU_BASE_URL "${XPU_BASE_URL_WITHOUT_DATE}/20220928")
else() else()
set(XPU_BASE_URL "${XPU_BASE_URL}") set(XPU_BASE_URL "${XPU_BASE_URL}")
endif() endif()
...@@ -19,7 +19,7 @@ endif() ...@@ -19,7 +19,7 @@ endif()
if(NOT DEFINED XPU_XDNN_BASE_URL) if(NOT DEFINED XPU_XDNN_BASE_URL)
set(XPU_XDNN_BASE_URL_WITHOUT_DATE set(XPU_XDNN_BASE_URL_WITHOUT_DATE
"https://klx-sdk-release-public.su.bcebos.com/xdnn/dev") "https://klx-sdk-release-public.su.bcebos.com/xdnn/dev")
set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220919") set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL_WITHOUT_DATE}/20220928")
else() else()
set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}") set(XPU_XDNN_BASE_URL "${XPU_XDNN_BASE_URL}")
endif() endif()
......
...@@ -123,20 +123,28 @@ int xpu_activation_1attr_func(const Context& dev_ctx, ...@@ -123,20 +123,28 @@ int xpu_activation_1attr_func(const Context& dev_ctx,
} }
template <typename Context, typename T, typename XPUType> template <typename Context, typename T, typename XPUType>
int xpu_activation_2attr_func( int xpu_activation_2attr_func(const Context& dev_ctx,
const Context& dev_ctx, const DenseTensor& x,
const DenseTensor& x, DenseTensor* out,
DenseTensor* out, float attr1,
float attr1, float attr2,
float attr2, std::function<int(xpu::Context*,
std::function< const XPUType*,
int(xpu::Context*, const XPUType*, XPUType*, int, float, float)> func) { XPUType*,
int,
float,
float,
const float*,
float*)> func) {
// does not support "const float* max_x, float* max_y" now
int r = func(dev_ctx.x_context(), int r = func(dev_ctx.x_context(),
reinterpret_cast<const XPUType*>(x.data<T>()), reinterpret_cast<const XPUType*>(x.data<T>()),
reinterpret_cast<XPUType*>(out->data<T>()), reinterpret_cast<XPUType*>(out->data<T>()),
x.numel(), x.numel(),
attr1, attr1,
attr2); attr2,
nullptr,
nullptr);
return r; return r;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册