Skip to content

Unified checks#1097

Merged
pavanky merged 37 commits into
arrayfire:develfrom
shehzan10:unified_checks
Nov 11, 2015
Merged

Unified checks#1097
pavanky merged 37 commits into
arrayfire:develfrom
shehzan10:unified_checks

Conversation

@shehzan10
Copy link
Copy Markdown
Member

Fixes #1068

Includes #1091 #1093 #1085

@shehzan10 shehzan10 added this to the 3.2.0 milestone Nov 10, 2015
@shehzan10
Copy link
Copy Markdown
Member Author

As additional information, we tried to do the af_array checks in the CALL macro using templates etc. The problem that we ran into was that there are functions that have arguments as void* / T* and these arguments we're going to the af_array (which is a void*) templated function. So right now, the CHECK_ARRAYS macro is the best solution we found.

@9prady9
Copy link
Copy Markdown
Member

9prady9 commented Nov 10, 2015

Do we really need another name space unified ? Neither the c/cpp API's have any name space like this. The only thing it is encapsulating is that symbol manager class and the checkArrays functions.

Another question is about, why can't we have CHECK_ARRAYS in ArrayFire C-API instead of unified API ? That way, we can add all the checks for af_array in one place. We do not do any af_array check in C-API right now, but if we do add any checks for af_array in future, the checks will become fragmented.

@shehzan10
Copy link
Copy Markdown
Member Author

Adding the unified namespace was @umar456's recommendation.

Having check array's in the c-api is of no use. When someone is using that backend by default (instead of going through the unified API), those checks will not do anything except add code. The role of these checks is limited to the unified api.

* Use this function when checking arrays in unified backend
@9prady9
Copy link
Copy Markdown
Member

9prady9 commented Nov 10, 2015

I think code(checks) fragmentation is much worse issue than having one or two additional statements that doesn't degrade performance.

Sure, the their role as they are written now is limited to unified API. But if we have individual checks in respective backend, we won't need to do this CHECK_ARRAYS in unified API all together. Yes, i think that is possible.

This was referenced Nov 10, 2015
…nto unified_checks

Conflicts:
	include/af/defines.h
@jramapuram
Copy link
Copy Markdown
Member

Just to confirm: if I do something like af_mul(a, b) and both arrays are on different devices will it return a AF_ERR_ARR_BKND_MISMATCH now ?

@pavanky
Copy link
Copy Markdown
Member

pavanky commented Nov 11, 2015

@jramapuram, that is the idea yes.

@shehzan10
Copy link
Copy Markdown
Member Author

build arrayfire tegra ci

@shehzan10 shehzan10 changed the title Unified checks - Review Unified checks Nov 11, 2015
pavanky added a commit that referenced this pull request Nov 11, 2015
@pavanky pavanky merged commit 1b8c231 into arrayfire:devel Nov 11, 2015
@shehzan10 shehzan10 mentioned this pull request Nov 12, 2015
4 tasks
@shehzan10 shehzan10 deleted the unified_checks branch November 12, 2015 20:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants