Vector Class Discussion

New C++ vector class library
Author: Agner Date: 2012-06-05 00:52
AVK wrote:
Nice work, but, frankly, this library should have been released somewhen in 1998-99, when AMD and Intel have released their first CPUs with 3DNow! and SSE, respectively. Nowadays, OpenCL is much more relevant.
I agree that this should have been done long ago. In fact, Intel did publish their vector class header files several years ago, but they didn't have enough features to really be useful.

OpenCL is a cross-platform language while my vector class library is carefully tweaked to the x86 and x86-64 instruction set extensions SSE2 through AVX2. It is intended as a tool to make it easier to use these specific instruction set extensions and get the maximum performance out of them without adding any extra runtime overhead. It works with some of the best optimizing C++ compilers available and can be combined with existing C++ code.

The advantage of OpenCL is that it can utilize the GPU. The main disadvantage is that it is a separate programming language and it doesn't have C++ constructs. A cross-platform language always has to make compromises for the sake of generality and portability.

OpenCL allows you to use types and vector sizes that don't fit the hardware registers. It even allows you to use types that work poorly on a specific platform, such as double precision on platforms that support only single precision.

In conclusion, OpenCL and my vector class library serve very different purposes.

 
thread New C++ vector class library new - Agner - 2012-05-30
replythread New C++ vector class library new - AVK - 2012-06-04
reply New C++ vector class library - Agner - 2012-06-05
last replythread New C++ vector class library new - Nick - 2012-06-13
last replythread New C++ vector class library new - Agner - 2012-06-13
last replythread New C++ vector class library new - Nick - 2012-06-13
last reply New C++ vector class library new - Matthias - 2012-06-24
last reply New C++ vector class library new - Stefan - 2012-06-08