Skip to content

af::arrray.device<>() returns NULL without eval #1316

@mricherzhagen

Description

@mricherzhagen

Not sure if this is intended behavior. But if it is, it should be added to the documentation of device():

af::setBackend(AF_BACKEND_CPU);

float v[] = {1, 2, 3, 4, 5};
array v_array = array(5, v);

array a_cpu = constant(0, 5,5);

a_cpu += matmulNT(v_array, v_array);
a_cpu.eval(); //Without this eval the device pointer is NULL. 
float *ptr = a_cpu.device<float>();
std::cout << "PTR: " << ptr << std::endl;

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions