Re: Accelerate framework / memory alignment questions
Re: Accelerate framework / memory alignment questions
- Subject: Re: Accelerate framework / memory alignment questions
- From: Jean-Daniel Dupas <email@hidden>
- Date: Tue, 1 Feb 2011 22:11:14 +0100
Le 1 févr. 2011 à 21:53, dct a écrit :
> I now understand that, to get accelerated performance, I need to set memory
> alignment for vector variables. I have several questions.
>
> a) I see that the syntax for a float variable declaration is:
> float vector[10] __attribute__ ((aligned));
> and that this results in 16-byte alignment.
> Would I set an allocated buffer in similar fashion? i.e.,
> vector = calloc( 10, sizeof(float) ) __attribute__ ((aligned));
man calloc
“The malloc(), calloc(), valloc(), realloc(), and reallocf() functions allocate memory. The allocated memory is aligned such that it can be used for any data
type, including AltiVec- and SSE-related types. The free() function frees allocations that were created via the preceding allocation functions.”
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden