* C/C++ extension for SIMD proposal
@ 2023-06-10 17:51 Jakub Juszczakiewicz
2023-06-10 18:12 ` Jakub Jelinek
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Juszczakiewicz @ 2023-06-10 17:51 UTC (permalink / raw)
To: gcc
Hi all,
I don't know is here right place for sharing ideas, but I don't
have idea, where I can send it.
I have simple idea. When I turned on OpenMP, for parallelly execute
simple for it's enough when I add line like this before loop:
#pragma omp parallel for
for (size_t i = 0; i < 1000000; i++)
vec_c[i] = vec_a[i] * vec_b[i];
Why don't use similar idea for show compiler that, it can by done by
SIMD CPU extension? e.g.
#pragma simd for
Maybe I'm wrong and there is better way for do it, and I don't know how.
If I'm right, maybe it could be idea for extend C/C++ in this way.
Best regards,
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: C/C++ extension for SIMD proposal
2023-06-10 17:51 C/C++ extension for SIMD proposal Jakub Juszczakiewicz
@ 2023-06-10 18:12 ` Jakub Jelinek
2023-06-10 18:23 ` Jakub Juszczakiewicz
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2023-06-10 18:12 UTC (permalink / raw)
To: Jakub Juszczakiewicz; +Cc: gcc
On Sat, Jun 10, 2023 at 07:51:10PM +0200, Jakub Juszczakiewicz via Gcc wrote:
> Hi all,
>
> I don't know is here right place for sharing ideas, but I don't have
> idea, where I can send it.
> I have simple idea. When I turned on OpenMP, for parallelly execute simple
> for it's enough when I add line like this before loop:
>
> #pragma omp parallel for
> for (size_t i = 0; i < 1000000; i++)
> vec_c[i] = vec_a[i] * vec_b[i];
>
> Why don't use similar idea for show compiler that, it can by done by SIMD
> CPU extension? e.g.
>
> #pragma simd for
Use
#pragma omp simd
for that.
That is part of OpenMP for years.
Jakub
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: C/C++ extension for SIMD proposal
2023-06-10 18:12 ` Jakub Jelinek
@ 2023-06-10 18:23 ` Jakub Juszczakiewicz
0 siblings, 0 replies; 3+ messages in thread
From: Jakub Juszczakiewicz @ 2023-06-10 18:23 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: gcc
Hi.
Thanks for fast reply. I will check this, because I didn't know that.
BR,
Jakub
On 10.06.2023 20:12, Jakub Jelinek wrote:
> On Sat, Jun 10, 2023 at 07:51:10PM +0200, Jakub Juszczakiewicz via Gcc wrote:
>> Hi all,
>>
>> I don't know is here right place for sharing ideas, but I don't have
>> idea, where I can send it.
>> I have simple idea. When I turned on OpenMP, for parallelly execute simple
>> for it's enough when I add line like this before loop:
>>
>> #pragma omp parallel for
>> for (size_t i = 0; i < 1000000; i++)
>> vec_c[i] = vec_a[i] * vec_b[i];
>>
>> Why don't use similar idea for show compiler that, it can by done by SIMD
>> CPU extension? e.g.
>>
>> #pragma simd for
> Use
> #pragma omp simd
> for that.
> That is part of OpenMP for years.
>
> Jakub
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-06-10 18:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-10 17:51 C/C++ extension for SIMD proposal Jakub Juszczakiewicz
2023-06-10 18:12 ` Jakub Jelinek
2023-06-10 18:23 ` Jakub Juszczakiewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).