Skip to content

Array iterators don't work when copied from host to device #1647

@publixsubfan

Description

@publixsubfan

When working on #1646, one issue I discovered was passing axom::Array::begin() and axom::Array::end() to FlatMap::insert resulted in memory errors on CUDA/HIP. This is because the current implementation takes a pointer to axom::Array:

public:
using ArrayPointerType = ArrayType*;

ArrayPointerType m_arrayPtr {nullptr};

If the Array instance is allocated on the stack, i.e. any Array variable defined in a function, this results in an access to host-only memory. We should evaluate if it would be more appropriate to store an ArrayView as the "pointer."

Metadata

Metadata

Assignees

No one assigned

    Labels

    CoreIssues related to Axom's 'core' componentGPUIssues related to GPU developmentReviewedenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions