Skip to content

Add support for frexp() function #6021

Open

Description

@Linyou

Does taichi has native support for frexp() function? The documention does not contain any info about frexp.

frexp() is a function that breaks a value into two components which are mantissa and exponent.

截屏2022-09-09 01 45 09

Activity

  1. moved this to Untriaged in Taichi Langon Sep 8, 2022
  2. victoriacity commented on Sep 13, 2022

    @victoriacity
    Member

    LLVM seems to have frexp() function, but indeed frexp() is not implemented in the Taichi frontend. @neozhaoliang do you think it would be worth adding to ti.Math module?

  3. bobcao3 commented on Sep 13, 2022

    @bobcao3
    Contributor

    ref: In SPIR-V there is FrexpStruct. In metal there is frexp

  4. neozhaoliang commented on Sep 14, 2022

    @neozhaoliang
    Contributor

    I think it's good to have this function.

  5. Linyou commented on Sep 14, 2022

    @Linyou
    ContributorAuthor

    Thanks for the great work!

  6. moved this from Untriaged to Todo in Taichi Langon Sep 16, 2022
  7. Lithaca commented on Sep 26, 2022

    @Lithaca

    I am interested in this issue and want to work on it. I am new to taichi, is there any reference material about how to get start.

  8. lin-hitonami commented on Nov 7, 2022

    @lin-hitonami
    Contributor

    Hi @Lithaca, sorry for the late reply. I've looked into the issue and I found that it is a bit hard to add it directly to the IR because it returns two numbers. However, we can write a Taichi function instead to do the same thing. We can add the function to our math module. Here is a possible implementation of frexp written in Java. Here is the documentation of Taichi. Welcome to contribute to our codebase if you are still interested.

  9. ailzhang commented on Apr 4, 2023

    @ailzhang
    Contributor

    FYI #7721 added support for CUDA backend, will send out a separate PR for spirv-based (and maybe CPU) backend in the future (lower pri for now).

  10. aezyus commented on May 9, 2026

    @aezyus

    I see this issue is still open, I would love to work on it. Do consider.
    ~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions