Skip to content

Conversation

@jushg
Copy link

@jushg jushg commented Jan 5, 2026

Description

CUmemGenericAllocationHandle is defined as unsigned long long (not a pointer type). Initializing it with nullptr is invalid in C++ since nullptr cannot be implicitly converted to an integer type. This causes a compilation error with Clang:

error: cannot initialize a member subobject of type 'CUmemGenericAllocationHandle' 
(aka 'unsigned long long') with an rvalue of type 'std::nullptr_t'

Why this was not caught with Makefile build?

NVIDIA's Makefile build uses NVCC with GCC as the host compiler, which historically allows implicit nullptr to integer conversions as a GCC extension (with only a warning). Clang rejects this as a hard error per the C++ standard.

Related Issues

Changes & Impact

This was the original code in v2.28, only change in v2.29 to nullptr, so this PR just revert that.

Performance Impact

Fix Clang build problem with wrong type
@jushg jushg changed the title [small fix] Fix Invalid nullptr initialization for CUmemGenericAllocationHandle when compiling with Clang Fix Invalid nullptr initialization for CUmemGenericAllocationHandle when compiling with Clang Jan 5, 2026
@jushg jushg changed the title Fix Invalid nullptr initialization for CUmemGenericAllocationHandle when compiling with Clang fix: Invalid nullptr initialization for CUmemGenericAllocationHandle when compiling with Clang Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant