Skip to content

SCALE cannot lower cuda::std::expf ("no libcall available for fexp") #59

Description

@diskdog

Problem

A call to cuda::std::expf from libcu++ <cuda/cmath> fails to compile under SCALE. The front end accepts it; codegen aborts with no libcall available for fexp. nvcc compiles the same call. Plain expf from <math.h> compiles fine, so this is specific to the cuda::std:: overload.

Reproducer

#include <cuda/cmath>
__global__ void k(float* r, const float* x) { r[0] = cuda::std::expf(x[0]); }

nvcc -arch=sm_75 -std=c++17 -c compiles. SCALE to NVIDIA (llvm/bin/nvcc -arch=sm_75 -std=c++17 -c) fails:

error: no libcall available for fexp

Likely cause

The libcu++ exp overload lowers to an fexp intrinsic the backend has no libcall for. <math.h> expf/exp2f/expm1f lower fine, so the gap is in the cuda::std:: path.

Toolchain: SCALE unstable-2026.07.08 (clang 20.1.8), NVIDIA target sm_75.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Compiler'tis a compiler bug.bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions