From b13a1030615a5952dba3c6890300df8197285c95 Mon Sep 17 00:00:00 2001 From: Raghu Raja Date: Thu, 14 Mar 2024 20:30:58 +0000 Subject: [PATCH] nccl headers: Fail if type unknown Fail compilation if neither definition was found rather than having a fall-through case. Signed-off-by: Raghu Raja --- include/nccl-headers/error.h | 6 ++++-- include/nccl-headers/net.h | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/nccl-headers/error.h b/include/nccl-headers/error.h index 85e58bdf7..1afc7dce4 100644 --- a/include/nccl-headers/error.h +++ b/include/nccl-headers/error.h @@ -1,5 +1,5 @@ /* - * 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 @@ -7,8 +7,10 @@ #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 diff --git a/include/nccl-headers/net.h b/include/nccl-headers/net.h index e1d47fd8b..d632abe7c 100644 --- a/include/nccl-headers/net.h +++ b/include/nccl-headers/net.h @@ -1,5 +1,5 @@ /* - * 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 @@ -7,8 +7,10 @@ #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