Re: Accelerate framework / memory alignment questions
Re: Accelerate framework / memory alignment questions
- Subject: Re: Accelerate framework / memory alignment questions
- From: dct <email@hidden>
- Date: Tue, 01 Feb 2011 13:32:19 -0800
Jean-Daniel
Thank you for the quick reply.
So, as I understand things, I only need to force the alignment of array variables. And, given that I have only a few of those involved with accelerated functions, I don't need to worry about forcing things across the entire project.
Don
On Feb 1, 2011, at 1:11 PM, Jean-Daniel Dupas wrote:
>
> 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