mkcolg
Joined: 30 Jun 2004 Posts: 4996 Location: The Portland Group Inc.
|
Posted: Thu Dec 24, 2009 9:04 am Post subject: |
|
|
Hi ghandurah,
| Quote: | PGC-W-0046-Non-integral array subscript is cast to int (Acc: 1158)
PGC-W-0046-Non-integral array subscript is cast to int (Acc: 1162) |
These warnings are most likely for "I". Since I uses a "2.5", the value will be a float. These warnings are letting you know that the value is being cast to an int in order to be used as a subscript.
| Quote: | 464, Accelerator restriction: size of the GPU copy of an array depends on values computed in this loop
465, Accelerator restriction: size of the GPU copy of 'A' is unknown
Accelerator restriction: size of the GPU copy of 'B' is unknown
Accelerator restriction: one or more arrays have unknown size
|
You need to use the copy clauses to tell the compiler how much of A and B to copy over to the GPU. Something like:
| Code: | | #pragma acc region copy(A[0:AMAX]), copyin(B[0:BMAX]) |
| Quote: | | Is it better to use "acc region" or "acc for" for loops like the one above? |
You must use an acc region to define the accelerator region. The acc for is optional but can be used to adjust the GPU schedule.
| Quote: | | any recommendations? given that the arrays will actually be much larger in size. | Just make sure that your GPU has enough memory. If not, then you'll need to add an outer strip mine loop (i.e. send over portions of the array a time).
| Quote: | | but didn't recognize the other libraries referenced in it | This isn't a library we ship, hence, you add "-L/path/to/library" on your link line so the linker can find it.
I should note that don't yet support calling CUDA functions from within an accelerator region.
- Mat |
|