Skip to content

Complex numbers in occa kernels #256

Description

@E-Stroem

Hello,
Is there a way to use C complex numbers and math inside an OCCA kernel?

E.g. the following C code in OCCA kernel:
double complex z1 = 1.0 + 2.0 * I
double complex z2 = 1.0 + 2.0 * I
double complex z3 = z1*z2;

and equivalent creal and cimag functions

Best regards,
E-Stroem

Activity

  1. dmed256 commented on Oct 28, 2019

    @dmed256
    Member

    Hi @E-Stroem,

    Good question, I haven't thought about adding complex functions!

    One of the goals for the 2019 year is to add basic math methods that work on all backends. Like max would use std::max or just max for OpenCL/CUDA. Some support for that is already in OCCA kernels, but not everything. Adding complex methods like creal and cimag could be done in the same work.

    I'm not too familiar with the standard complex methods, do you have a reference or list to some that might be handy?

  2. locked and limited conversation to collaborators on Aug 24, 2023
  3. converted this issue into a discussion #706 on Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureUse this label to request a new feature!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions