Skip to content

Compute-Intensive Kernel Hits NaN #71

@frobnitzem

Description

@frobnitzem

This kernel:

A[i] = _mm256_fmadd_pd(A[i], A[i], A[i]);

repeatedly applies
A = A*A + A (i.e. fmadd(A, A, A))
which quickly escalates to A=NaN.

To avoid this, the kernel can be changed to
A = -A*A + A (i.e. fnmsub(A, A, A)).

This makes the iteration equivalent to the Logistic map with r=1.
Adjusting the initial condition to A = 0.7 (or anything between 0 and 1) makes the iterations converge slowly to 0 over time.

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