2

I have been experimenting with Haskell's Accelerate and I was wondering how I could resize a vector (Array DIM1 a)? I noticed reshape but it the size of the source and result must be the same but I want to double the size.

user3199023
  • 433
  • 2
  • 8

1 Answers1

2

Going by Do Accelerate and Repa have different use cases?:

Accelerate is an embedded language for GPU programming. Accelerate relies on its own compiler and GPU parallelism for performance. A piece of code using the Accelerate library doesn't actually do array computation. It generates an Accelerate program, which is processed by Accelerate's own compiler to generate the code that actually processes your array data.

It's likely impossible, since CUDA uses standard C arrays size of which can't be changed.

Community
  • 1
  • 1
Alexey Romanov
  • 167,066
  • 35
  • 309
  • 487
  • I do think it's possible by writing accelerate code to use cudaMemcpy, cudaMalloc but my Haskell knowledge is lacking to understand its code. I will ask the authors of accelerate. – user3199023 Mar 18 '14 at 17:12
  • 1
    Well, you wouldn't be resizing a vector, but creating a different one of different size, which obviously should be possible. – Alexey Romanov Mar 18 '14 at 17:33