Skip to content

Enzyme failed to complie for the custom gradient for C++ on cuda #2305

@minansys

Description

@minansys

Enzyme failed to complie for the custom gradient for C++ as show in this example for the atomicMax

https://fwd.gymni.ch/hc3ivR

which crashed at

if (hasMetadata(key.todiff, "enzyme_gradient")) {
std::set<llvm::Type *> seen;
DIFFE_TYPE subretType = whatType(key.todiff->getReturnType(),
DerivativeMode::ReverseModeGradient,
/intAreConstant/ false, seen);
if (key.todiff->getReturnType()->isVoidTy() ||
key.todiff->getReturnType()->isEmptyTy())
subretType = DIFFE_TYPE::CONSTANT;

@wsmoses will have the fix for this and provide a better msg.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions