File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed
fluid/platform/device/gpu Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -99,10 +99,11 @@ struct GpuLaunchConfig {
99
99
inline GpuLaunchConfig GetGpuLaunchConfig1D (
100
100
const platform::CUDADeviceContext& context, int64_t numel,
101
101
int vec_size = 1 ) {
102
- PADDLE_ENFORCE_GT (numel, 0 , platform::errors::InvalidArgument (
103
- " element quantity should be greater than 0,"
104
- " but received value is: %d." ,
105
- numel));
102
+ PADDLE_ENFORCE_GE (numel, 0 ,
103
+ platform::errors::InvalidArgument (
104
+ " element quantity should be greater than or equal to 0,"
105
+ " but received value is: %d." ,
106
+ numel));
106
107
// Get compute_capability
107
108
const int capability = context.GetComputeCapability ();
108
109
/* If thread number per block is 64/128/256/512, cuda performs better.*/
Original file line number Diff line number Diff line change @@ -101,12 +101,12 @@ struct GpuLaunchConfig {
101
101
inline GpuLaunchConfig GetGpuLaunchConfig1D (const phi::GPUContext& context,
102
102
int64_t numel,
103
103
int vec_size = 1 ) {
104
- PADDLE_ENFORCE_GT (
105
- numel ,
106
- 0 ,
107
- phi::errors::InvalidArgument ( " element quantity should be greater than 0,"
108
- " but received value is: %d." ,
109
- numel));
104
+ PADDLE_ENFORCE_GE (numel,
105
+ 0 ,
106
+ phi::errors::InvalidArgument (
107
+ " element quantity should be greater than or equal to 0,"
108
+ " but received value is: %d." ,
109
+ numel));
110
110
// Get compute_capability
111
111
const int capability = context.GetComputeCapability ();
112
112
/* If thread number per block is 64/128/256/512, cuda performs better.*/
You can’t perform that action at this time.
0 commit comments