Page MenuHome

cycles math.h: preprocess cuda/metal builtins before arm64
ClosedPublic

Authored by Tianhao Chai (cth451) on Jul 29 2022, 12:27 AM.

Details

Summary

Problem:

Currently arm64 assembly support is checked before cuda/metal in u32
inversion routine. Under nvcc context, C++ preprocessor will incorrectly
generate inlined arm64 assembly instead of calls to cuda built-in
functions. This causes nvcc to error out on ARM64:

.../intern/cycles/kernel/../util/math.h(930): error: A sm operand
modifier not supported at "%w", try removing modifier or
escaping with %

In the case of Metal, current ifdef ordering causes Metal code paths to
not generate at all.

Solution:

Do CUDA / Metal ifdef's first before ifdef'ing ARM64 native instructions.

Diff Detail

Repository
rB Blender

Event Timeline

Tianhao Chai (cth451) requested review of this revision.Jul 29 2022, 12:27 AM
Tianhao Chai (cth451) created this revision.
Tianhao Chai (cth451) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 29 2022, 2:45 PM