Skip to content

rtdevlib: fix function signature mismatches#851

Merged
pvelesko merged 1 commit intomainfrom
fix-fnty-mismatch
May 22, 2024
Merged

rtdevlib: fix function signature mismatches#851
pvelesko merged 1 commit intomainfrom
fix-fnty-mismatch

Conversation

@linehill
Copy link
Collaborator

A issue discovered while running HIP programs on OpenCL-BE->rusticl (with #830). Linking of __chip_atomic_add_f* symbols failed because the caller's and callee's function signature differed by their pointer parameters (pointee type didn't match).

The mismatch was caused by LLVM-SPIRV-Translator's feature that attempts to recover original pointee types in LLVM bitcodes that use opaque pointers. But the way it attempts to infer the types may end up with SPIR-V functions with different pointee type across SPIR-V modules.

The issue is worked around by passing pointers as integers for functions whose definitions are linked in at runtime.

A issue discovered while running HIP programs on OpenCL-BE->rusticl
(with #830). Linking of __chip_atomic_add_f* symbols failed because
the caller's and callee's function signature differed by their pointer
parameters (pointee type didn't match).

The mismatch was caused by LLVM-SPIRV-Translator's feature that
attempts to recover original pointee types in LLVM bitcodes that use
opaque pointers. But the way it attempts to infer the types may end up
with SPIR-V functions with different pointee type across SPIR-V
modules.

The issue is worked around by passing pointers as integers for
functions whose definitions are linked in at runtime.
@pvelesko pvelesko merged commit 7be22a5 into main May 22, 2024
@linehill linehill deleted the fix-fnty-mismatch branch May 22, 2024 12:24
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.

3 participants