Skip to content

[BUG] isfinite(), isnan(), and isinf() should only accept float types #847

@c0d1f1ed

Description

@c0d1f1ed

Bug Description

Currently wp.isfinite(), wp.isnan(), and isinf() accept integer scalars and vectors, which arguably does not produce useful results.

Arguments pro accepting integer arguments:

  • Python does accept scalar integers for these math functions, but this appears to involve an implicit conversion, which Warp kernels do not support. Type safety is an exception to supporting Pythonic syntax and semantics in kernels, to facilitate translation to CUDA and preserve performance.

Arguments against accepting integer arguments:

  • It requires ~100 function signatures which serve no practical purpose and slow down compilation.
  • Other floating-point math functions (e.g. wp.sqrt()) just accept Float arguments, even when Python (implicitly) also accepts integers.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions