Use of AMP C++ is slow !! RRS feed

  • Question

  • Hello,

    I have used for Matrix multiplication AMP C++, and it works great, the problème is when i have use it as a function in a programme, the grogramme become slow and it consume a lot of memory when executing, i am using VS2012.

    PS: i am executin in debug mode type GPU, when passing to release it wont work because of the use of array_view<double>!!!!!

    Thank you a lot for you answers

    Monday, June 10, 2013 11:18 AM

All replies

  • You've got to fix your problems which are preventing you from using release mode.  Debug mode is never a viable mode to use when measuring performance.   Please provide more information about what the exact problems are when compiling in release mode.
    Wednesday, June 12, 2013 11:34 AM
  • If you switch to single-precision can you get the release version to run?
    Wednesday, June 12, 2013 2:35 PM
  • As it has been hinted in previous responses, I would guess that your program is failing to execute in Release mode, because your GPU does not support double precision (either limited or full, depending on operations you are using in your kernel, like double division). You can verify this a priori by checking accelerator::supports_double_precision or accelerator::supports_limited_double_precision property. In such case parallel_for_each will throw a concurrency::runtime_exception with message pointing to this problem -- having exception handler in your code that would at least log the exception message would be very helpful.

    In GPU debugging mode, the Visual Studio environment forces the runtime to use direct3d_ref accelerator, which indeed supports double precision, but, as you are observing, is extremely slow and intended only for debugging / correctness verification.

    If I were guessing correctly, the solution in your case would be to change the kernel implementation to single precision floating point (i.e. use float instead of double, not forgetting literals - 1.0f v 1.0), or if the latter is absolutely necessary -- upgrade your system to support double precision (it can mean either upgrading GPU, or OS, or both - more details here).

    Friday, June 28, 2013 3:04 PM