Description
Summary of Problem
Description:
As a result of some of the discussion on #27266 starting around this comment, I found myself wondering whether c_ptrTo()
, when applied to an array view whose logical elements were not contiguous, would return a pointer or not. My sense is that it probably should not, much like how we don't support it on other arrays whose data is not contiguous, like a block-distributed array. Here's an example that I think should not work:
use CTypes;
config const n = 100;
var A: [1..n, 1..n] real;
var p = c_ptrTo(A[2..n-1, 2..n-1]);
writeln(p);
As in the discussion referenced above, there's a question as to whether this should be a static check ("This is an array view, so it's not generally possible to apply c_ptrTo()
to it because the data may not be contiguous") or a dynamic one (e.g., if n==3 above, the slice would be a single element, so would be contiguous).
Is this issue currently blocking your progress?
no
Configuration Information
- Output of
chpl --version
: 2.2.0