Skip to content

Commit

Permalink
nccl headers: Fail if type unknown
Browse files Browse the repository at this point in the history
Fail compilation if neither definition was found rather than
having a fall-through case.

Signed-off-by: Raghu Raja <[email protected]>
  • Loading branch information
rajachan authored and bwbarrett committed Mar 30, 2024
1 parent d91e9bf commit b13a103
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions include/nccl-headers/error.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/*
* Copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright (c) 2023-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef NCCL_HEADERS_ERROR_H
#define NCCL_HEADERS_ERROR_H

#if HAVE_CUDA
#include "nccl-headers/nvidia/err.h"
#else
#elif HAVE_NEURON
#include "nccl-headers/neuron/error.h"
#else
#error "Neither CUDA nor Neuron support is available"
#endif

#endif
6 changes: 4 additions & 2 deletions include/nccl-headers/net.h
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
/*
* Copyright (c) 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
* Copyright (c) 2023-2024 Amazon.com, Inc. or its affiliates. All rights reserved.
*/

#ifndef NCCL_HEADERS_NET_H
#define NCCL_HEADERS_NET_H

#if HAVE_CUDA
#include "nccl-headers/nvidia/net.h"
#else
#elif HAVE_NEURON
#include "nccl-headers/neuron/net.h"
#else
#error "Neither CUDA nor Neuron support is available"
#endif

#endif

0 comments on commit b13a103

Please sign in to comment.