Re: How to create a library that detects the processor and uses SIMD instructions as necessary
- From: Tim Roberts <spamtrap@xxxxxxxxxx>
- Date: Tue, 19 Sep 2006 05:17:43 GMT
"ldb" <spamtrap@xxxxxxxxxx> wrote:
The cleanest way to do this would be to determine which version to use
at compile-time, and compile the correct functions into the executable.
If distributing source isn't an option, you can just compile two
completely seperate executables, and call the correct one at run-time.
Doing it "on the fly" or "just in time" is going to cost too much
computationally, in general.
That's just nonsense. Intel does this in virtually every
computationally-intensive application and driver they deliver. You call
one function at init time that sets up a table of function pointers.
Performance delta is exactly the same as the difference between a straight
function call and a C++ virtual function call. Since this is only used for
computationally-intensive functions, the overhead is irrelevant.
--
- Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Prev by Date: Re: How to generate a #SMI?
- Next by Date: Re: How to generate a #SMI?
- Previous by thread: Re: How to create a library that detects the processor and uses SIMD instructions as necessary
- Next by thread: Re: How to create a library that detects the processor and uses SIMD instructions as necessary
- Index(es):
Relevant Pages
|
|