Skip to content

Commit

Permalink
Replace diag_suppress by nv_diag_suppress [skip-tests]
Browse files Browse the repository at this point in the history
nvcc version 11 warns that diag_suppress is deprecated. Version 12 does
not support it anymore. nv_diag_suppress works.
  • Loading branch information
ahendriksen authored and miscco committed Aug 15, 2023
1 parent 4d01371 commit 067064e
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ warning: dynamic initialization is not supported for a function-scope static
__shared__ variable within a __device__/__global__ function
```

It can be silenced using `#pragma diag_suppress static_var_with_dynamic_init`.
It can be silenced using `#pragma nv_diag_suppress static_var_with_dynamic_init`.

To properly initialize a `__shared__` `cuda::barrier`, use the
[`cuda::barrier::init`] friend function.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ warning: dynamic initialization is not supported for a function-scope static
__shared__ variable within a __device__/__global__ function
```

It can be silenced using `#pragma diag_suppress static_var_with_dynamic_init`.
It can be silenced using `#pragma nv_diag_suppress static_var_with_dynamic_init`.

## Example

```cuda
#include <cuda/barrier>
// Disables `pipeline_shared_state` initialization warning.
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
__global__ void example_kernel() {
__shared__ cuda::barrier<cuda::thread_scope_block> bar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ A `cuda::pipeline` object.
#include <cooperative_groups.h>
// Disables `pipeline_shared_state` initialization warning.
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
__global__ void example_kernel() {
__shared__ cuda::pipeline_shared_state<cuda::thread_scope_block, 2> pss0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ A thread role cannot change during the lifetime of the pipeline object.
#include <cooperative_groups.h>
// Disables `pipeline_shared_state` initialization warning.
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
template <typename T>
__device__ void compute(T* ptr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If the pipeline is in a _quitted state_ (see [`cuda::pipeline::quit`]), the
#include <cuda/pipeline>
// Disables `barrier` initialization warning.
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
__global__ void
example_kernel(cuda::std::uint64_t* global, cuda::std::size_t element_count) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ warning: dynamic initialization is not supported for a function-scope static
__shared__ variable within a __device__/__global__ function
```

It can be silenced using `#pragma diag_suppress static_var_with_dynamic_init`.
It can be silenced using `#pragma nv_diag_suppress static_var_with_dynamic_init`.

## Example

```cuda
#include <cuda/pipeline>
// Disables `pipeline_shared_state` initialization warning.
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
__global__ void example_kernel(char* device_buffer, char* sysmem_buffer) {
// Allocate a 2 stage block scoped shared state in shared memory.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Construct a [`cuda::pipeline`] _shared state_ object.
```cuda
#include <cuda/pipeline>
#pragma diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress static_var_with_dynamic_init
__global__ void example_kernel() {
__shared__ cuda::pipeline_shared_state<cuda::thread_scope_block, 2> shared_state;
Expand Down

0 comments on commit 067064e

Please sign in to comment.