diff --git a/paddle/phi/core/kernel_factory.h b/paddle/phi/core/kernel_factory.h index 0c85f8d49cc2fdd273f510d67616d484047b4f8e..d69cb7802b6c6747674e5a69fb4dc02dc10fee66 100644 --- a/paddle/phi/core/kernel_factory.h +++ b/paddle/phi/core/kernel_factory.h @@ -67,17 +67,19 @@ class KernelKey { KernelKey(Backend backend, DataLayout layout, DataType dtype) : backend_(backend), layout_(layout), dtype_(dtype) {} - explicit KernelKey(Place place) + explicit KernelKey(const Place& place) : backend_(TransToPhiBackend(place)), layout_(DataLayout::ALL_LAYOUT), dtype_(DataType::ALL_DTYPE) {} - explicit KernelKey(const int& dtype, Place place) + explicit KernelKey(const int& dtype, const Place& place) : backend_(TransToPhiBackend(place)), layout_(DataLayout::ALL_LAYOUT), dtype_(phi::TransToPhiDataType(dtype)) {} - explicit KernelKey(Place place, DataLayout layout, DataType dtype) + explicit KernelKey(const Place& place, + const DataLayout& layout, + const DataType& dtype) : backend_(TransToPhiBackend(place)), layout_(layout), dtype_(dtype) {} Backend backend() const { return backend_; }