Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions paddle/phi/common/backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,13 @@ inline Backend StringToBackend(const char* backend_cstr) {
} else if (s == std::string("GPUDNN")) {
return Backend::GPUDNN;
} else if (s == std::string("KPS")) {
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
// KPS is not yet a complete backend, and it still needs to be converted
// to GPU in the GPU environment
return Backend::GPU;
#else
return Backend::KPS;
#endif
} else {
return static_cast<Backend>(static_cast<size_t>(Backend::NUM_BACKENDS) +
phi::GetOrRegisterGlobalDeviceTypeId(s));
Expand Down
8 changes: 4 additions & 4 deletions paddle/phi/kernels/kps/bitwise_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ PD_REGISTER_KERNEL(

#else
PD_REGISTER_KERNEL(bitwise_and,
GPU,
KPS,
ALL_LAYOUT,
phi::BitwiseAndKernel,
bool,
Expand All @@ -81,7 +81,7 @@ PD_REGISTER_KERNEL(bitwise_and,
int64_t) {}

PD_REGISTER_KERNEL(bitwise_or,
GPU,
KPS,
ALL_LAYOUT,
phi::BitwiseOrKernel,
bool,
Expand All @@ -92,7 +92,7 @@ PD_REGISTER_KERNEL(bitwise_or,
int64_t) {}

PD_REGISTER_KERNEL(bitwise_xor,
GPU,
KPS,
ALL_LAYOUT,
phi::BitwiseXorKernel,
bool,
Expand All @@ -103,7 +103,7 @@ PD_REGISTER_KERNEL(bitwise_xor,
int64_t) {}

PD_REGISTER_KERNEL(bitwise_not,
GPU,
KPS,
ALL_LAYOUT,
phi::BitwiseNotKernel,
bool,
Expand Down
12 changes: 6 additions & 6 deletions paddle/phi/kernels/kps/compare_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ PD_REGISTER_KERNEL(equal, KPS, ALL_LAYOUT, phi::EqualKernel, int) {}
PD_REGISTER_KERNEL(not_equal, KPS, ALL_LAYOUT, phi::NotEqualKernel, int) {}
#else
PD_REGISTER_KERNEL(less_than,
GPU,
KPS,
ALL_LAYOUT,
phi::LessThanKernel,
bool,
Expand All @@ -157,7 +157,7 @@ PD_REGISTER_KERNEL(less_than,
float,
double) {}
PD_REGISTER_KERNEL(less_equal,
GPU,
KPS,
ALL_LAYOUT,
phi::LessEqualKernel,
bool,
Expand All @@ -167,7 +167,7 @@ PD_REGISTER_KERNEL(less_equal,
float,
double) {}
PD_REGISTER_KERNEL(greater_than,
GPU,
KPS,
ALL_LAYOUT,
phi::GreaterThanKernel,
bool,
Expand All @@ -177,7 +177,7 @@ PD_REGISTER_KERNEL(greater_than,
float,
double) {}
PD_REGISTER_KERNEL(greater_equal,
GPU,
KPS,
ALL_LAYOUT,
phi::GreaterEqualKernel,
bool,
Expand All @@ -187,7 +187,7 @@ PD_REGISTER_KERNEL(greater_equal,
float,
double) {}
PD_REGISTER_KERNEL(equal,
GPU,
KPS,
ALL_LAYOUT,
phi::EqualKernel,
bool,
Expand All @@ -208,7 +208,7 @@ PD_REGISTER_KERNEL(not_equal,
double) {}

PD_REGISTER_KERNEL(equal_all,
GPU,
KPS,
ALL_LAYOUT,
phi::EqualAllKernel,
bool,
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/kernels/kps/logical_kernel.cu
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ PD_REGISTER_KERNEL(logical_Xor, KPS, ALL_LAYOUT, phi::LogicalXorKernel, int) {}
#else
#define REGISTER_LOGICAL_CUDA_KERNEL(logical_and, func_type) \
PD_REGISTER_KERNEL(logical_and, \
GPU, \
KPS, \
ALL_LAYOUT, \
phi::Logical##func_type##Kernel, \
float, \
Expand Down