Skip to content

Commit 554c348

Browse files
authored
Revert "Fix use of cuCtxCreate with Cuda 13.0 and newer"
1 parent 4bee61f commit 554c348

File tree

3 files changed

+2
-14
lines changed

3 files changed

+2
-14
lines changed

src/cuda_loader.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,7 @@ CUresult (*p_cuDeviceGetCount)(int *) = NULL;
1010
CUresult (*p_cuDeviceGet)(CUdevice *, int) = NULL;
1111
CUresult (*p_cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice) = NULL;
1212
CUresult (*p_cuDeviceGetName)(char *, int, CUdevice) = NULL;
13-
#if CUDA_VER >= 13000
14-
CUresult (*p_cuCtxCreate)(CUcontext *, CUctxCreateParams *, unsigned int, CUdevice) = NULL;
15-
#else
1613
CUresult (*p_cuCtxCreate)(CUcontext *, unsigned int, CUdevice) = NULL;
17-
#endif
1814
CUresult (*p_cuDevicePrimaryCtxRetain)(CUcontext *, CUdevice) = NULL;
1915
CUresult (*p_cuCtxSetCurrent)(CUcontext) = NULL;
2016
CUresult (*p_cuCtxDestroy)(CUcontext) = NULL;

src/cuda_loader.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ extern CUresult (*p_cuDeviceGetCount)(int *);
3030
extern CUresult (*p_cuDeviceGet)(CUdevice *, int);
3131
extern CUresult (*p_cuDeviceGetAttribute)(int *, CUdevice_attribute, CUdevice);
3232
extern CUresult (*p_cuDeviceGetName)(char *, int, CUdevice);
33-
#if CUDA_VER >= 13000
34-
extern CUresult (*p_cuCtxCreate)(CUcontext *, CUctxCreateParams *, unsigned int, CUdevice);
35-
#else
3633
extern CUresult (*p_cuCtxCreate)(CUcontext *, unsigned int, CUdevice);
37-
#endif
3834
extern CUresult (*p_cuDevicePrimaryCtxRetain)(CUcontext *, CUdevice);
3935
extern CUresult (*p_cuCtxSetCurrent)(CUcontext);
4036
extern CUresult (*p_cuCtxDestroy)(CUcontext);
@@ -65,4 +61,4 @@ void unload_cuda_library(void);
6561
}
6662
#endif
6763

68-
#endif // CUDA_LOADER_H
64+
#endif // CUDA_LOADER_H

src/cuda_memory.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause */
22
/*
3-
* Copyright 2023-2025 Amazon.com, Inc. or its affiliates. All rights reserved.
3+
* Copyright 2023 Amazon.com, Inc. or its affiliates. All rights reserved.
44
*/
55

66
#include <stdio.h>
@@ -96,11 +96,7 @@ static int init_gpu(struct cuda_memory_ctx *ctx)
9696
printf("creating CUDA Ctx\n");
9797

9898
/* Create context */
99-
#if CUDA_VER >= 13000
100-
error = p_cuCtxCreate(&ctx->cuContext, NULL, CU_CTX_MAP_HOST, ctx->cuDevice);
101-
#else
10299
error = p_cuCtxCreate(&ctx->cuContext, CU_CTX_MAP_HOST, ctx->cuDevice);
103-
#endif
104100
if (error != CUDA_SUCCESS) {
105101
printf("cuCtxCreate() error=%d\n", error);
106102
return FAILURE;

0 commit comments

Comments
 (0)