Fix device OpenMP build (#894)
* Remove SyncCompute call to fix compilation with device omp * Fix hypre_SeqVectorAxpyzDevice implementation for device omp * Add warning for function not implemented for device omp
This commit is contained in:
parent
ba1f15b082
commit
82b40f72f4
@ -92,7 +92,6 @@ hypre_SeqVectorScaleDevice( HYPRE_Complex alpha,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
hypre_SyncComputeStream(hypre_handle());
|
|
||||||
hypre_GpuProfilingPopRange();
|
hypre_GpuProfilingPopRange();
|
||||||
|
|
||||||
return hypre_error_flag;
|
return hypre_error_flag;
|
||||||
@ -172,7 +171,7 @@ hypre_SeqVectorAxpyzDevice( HYPRE_Complex alpha,
|
|||||||
#pragma omp target teams distribute parallel for private(i) is_device_ptr(z_data, y_data, x_data)
|
#pragma omp target teams distribute parallel for private(i) is_device_ptr(z_data, y_data, x_data)
|
||||||
for (i = 0; i < total_size; i++)
|
for (i = 0; i < total_size; i++)
|
||||||
{
|
{
|
||||||
z_data[i] = alpha * x_data[i] + beta * z_data[i];
|
z_data[i] = alpha * x_data[i] + beta * y_data[i];
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -190,6 +189,7 @@ hypre_SeqVectorElmdivpyDevice( hypre_Vector *x,
|
|||||||
HYPRE_Int *marker,
|
HYPRE_Int *marker,
|
||||||
HYPRE_Int marker_val )
|
HYPRE_Int marker_val )
|
||||||
{
|
{
|
||||||
|
#if defined(HYPRE_USING_GPU)
|
||||||
HYPRE_Complex *x_data = hypre_VectorData(x);
|
HYPRE_Complex *x_data = hypre_VectorData(x);
|
||||||
HYPRE_Complex *b_data = hypre_VectorData(b);
|
HYPRE_Complex *b_data = hypre_VectorData(b);
|
||||||
HYPRE_Complex *y_data = hypre_VectorData(y);
|
HYPRE_Complex *y_data = hypre_VectorData(y);
|
||||||
@ -199,8 +199,6 @@ hypre_SeqVectorElmdivpyDevice( hypre_Vector *x,
|
|||||||
HYPRE_Int size = hypre_VectorSize(b);
|
HYPRE_Int size = hypre_VectorSize(b);
|
||||||
|
|
||||||
hypre_GpuProfilingPushRange("SeqVectorElmdivpyDevice");
|
hypre_GpuProfilingPushRange("SeqVectorElmdivpyDevice");
|
||||||
|
|
||||||
#if defined(HYPRE_USING_GPU)
|
|
||||||
if (num_vectors_b == 1)
|
if (num_vectors_b == 1)
|
||||||
{
|
{
|
||||||
if (num_vectors_x == 1)
|
if (num_vectors_x == 1)
|
||||||
@ -246,6 +244,8 @@ hypre_SeqVectorElmdivpyDevice( hypre_Vector *x,
|
|||||||
hypre_SyncComputeStream(hypre_handle());
|
hypre_SyncComputeStream(hypre_handle());
|
||||||
hypre_GpuProfilingPopRange();
|
hypre_GpuProfilingPopRange();
|
||||||
|
|
||||||
|
#elif defined(HYPRE_USING_OPENMP)
|
||||||
|
hypre_error_w_msg(HYPRE_ERROR_GENERIC, "Not implemented for device OpenMP!\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return hypre_error_flag;
|
return hypre_error_flag;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user