1) If I have a 2d array in x10 is there an easy way to extract the
   subarrays along a single dimension (e.g. suppose I have a 2d array
   representing the matrix
   [1 2
     3 4]
   Is there an easy way to get an array that is the row vector [1 2]

Hi Daniel --

I don't have a complete answer, but a direction you could go in to develop one. And also others may have something to share. Indeed, Dave Grove and Olivier Tardieu and others are re-designing arrays / rails to ensure efficiency for the basic case of rectangular multi-dim arrays, so this is a somewhat timely question.

The direction I would suggest is to actually write your own wrapper ArraySection[T] class that operates like an Array and implements its operations by passing them on to the contained Array. Actually, this is very much how x10.lang.Array is implemented already -- it encapsulates an "IndexedMemoryChunk", an efficient primitive representation of a array of T over the region 0..(N-1), and implements all operations by performing them on this state, using @Inline etc. You could ignore the @Native("cuda"....) annotations for now .. or ask David Cunningham for more information about how they are supposed to work.

You can start by looking at the code for Array and simply modifying it appropriately. This would be a worthwhile thing to do. You would get exposed to defining your own operators (e.g. for indexed access and update). And it might make the code for Lulesh look cleaner.

Dave Grove has thought more deeply about how to do Arrays efficiently (and implemented the Array code) and may have additional ideas to share.

Best,
Vijay
------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to