Skip to content

Commit 00c7e4f

Browse files
committed
[Clang] Correctly enable the f16 type for offloading
Summary: There's an extra argument that's required to *actually* enable f16 usage. For whatever reason there's a difference between fp16 and f16, where fp16 is some weird version that converts between the two. Long story short, without this the math builtins are blatantly broken.
1 parent 60ff9c2 commit 00c7e4f

File tree

2 files changed

+598
-54
lines changed

2 files changed

+598
-54
lines changed

clang/lib/Basic/Targets/NVPTX.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ class LLVM_LIBRARY_VISIBILITY NVPTXTargetInfo : public TargetInfo {
7575

7676
ArrayRef<Builtin::Info> getTargetBuiltins() const override;
7777

78+
bool useFP16ConversionIntrinsics() const override { return false; }
79+
7880
bool
7981
initFeatureMap(llvm::StringMap<bool> &Features, DiagnosticsEngine &Diags,
8082
StringRef CPU,

0 commit comments

Comments
 (0)