Skip to content

FEAT Function to return allocated bytes#1630

Merged
umar456 merged 3 commits intoarrayfire:develfrom
shehzan10:allocated-bytes
Oct 26, 2016
Merged

FEAT Function to return allocated bytes#1630
umar456 merged 3 commits intoarrayfire:develfrom
shehzan10:allocated-bytes

Conversation

@shehzan10
Copy link
Copy Markdown
Member

Fixes #1607

@shehzan10 shehzan10 added this to the v3.5.0 milestone Oct 17, 2016
size_t res = 0;

switch (ty) {
case f32: res = getArray<float >(arr).getDataDims().elements() * sizeof(float); break;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into the backend? This type of functionality should not be exposed in the API layer.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDataDims() is already available as a method to C-API. Whats the need to call it in the backend? It's just going to add redundant code.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a logical separation between the api and the backend codes. The api calls should not implement any functionality. It should only expose the backend state to the user.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is located misleadingly. This should have ideally been under src/backend/internal.cpp. All backends use this file internally so this is technically part of the backend code, not the api code.

@shehzan10
Copy link
Copy Markdown
Member Author

build arrayfire linux ci

@umar456 umar456 merged commit 3740ccb into arrayfire:devel Oct 26, 2016
@shehzan10 shehzan10 deleted the allocated-bytes branch November 11, 2016 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants