Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Uncompensated overtime? Just Say No.


devel / comp.lang.c / gpu extension to c

SubjectAuthor
* gpu extension to cfir
+- Re: gpu extension to cfir
`* Re: gpu extension to cPhilipp Klaus Krause
 `* Re: gpu extension to cfir
  `- Re: gpu extension to cBranimir Maksimovic

1
gpu extension to c

<b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18345&group=comp.lang.c#18345

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:ab15:: with SMTP id u21mr22245414qke.394.1632165134292; Mon, 20 Sep 2021 12:12:14 -0700 (PDT)
X-Received: by 2002:ac8:7003:: with SMTP id x3mr25121312qtm.284.1632165134155; Mon, 20 Sep 2021 12:12:14 -0700 (PDT)
Path: i2pn2.org!i2pn.org!aioe.org!feeder1.feed.usenet.farm!feed.usenet.farm!tr1.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 20 Sep 2021 12:12:13 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.157; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.157
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
Subject: gpu extension to c
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 20 Sep 2021 19:12:14 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 51
 by: fir - Mon, 20 Sep 2021 19:12 UTC

example:

int image[1024][1024];

video int image_in[1024][1024];
video int image_out[1024][1024];

video void BlurImageOnMpu( int current_channel_id ) by 1048576 channels
{ int id_x = current_channel_id%1024;
int id_y = current_channel_id/1024;
int value;
if(id_x==0) value = ( image_in[id_y][id_x] + image_in[id_y][id_x+1] ) /2;
else if(id_x==1023) value = ( image_in[id_y][id_x] + image_in[id_y][id_x-1] ) /2;
else
value = (image_in[id_y][id_x-1] + image_in[id_y][id_x] + image_in[id_y][id_x+2]) / 3 ;
//i know its nonsense coz its rgb not integer but for illistratuon of idea
image_out[id_y][id_x] = value;
} int main()
{ load_image("some.jpg", image);
copy_ram_to_vram(image_in, image, 1024*1024);
BlurImageOnMpu();
copy_vram_to_ram(image, image_out, 1024*1024);
save_image("some out.jpg", image);
return 1;
}

i was sleeping today and dreamin about writing gpu kernells stright form c language level.. (later i also reneme gpu as mpu = matrix processing unit as this name is more general)
it seem to me that only slight extension to c syntax need to be added mainly some keyword "video" or "mpu" which would denote that tis entity is to be lockated in vram not ram and this funstion is gpu kernel function not regular cpu one.. i use "video" keyword just to be more eye catching here
the code example is a intentiionally bit simplified for fixed image size and idiotic 'blur' code when i add argb pixels which is nonsense but it is to ilustrate c extension not to use real sense function whuch would be harder to read
beside "video" keyword one also need to dentote on how many parallel gpu/mpu/video channels given kernel function would be run - i use "by 1048576 parallel channels" stetement which is a bit long and also kinda syntactic stub,. it could be something else like [1048576] after function name or somethnig
not not that i got this idea in dream, i was thinkiong on this some years ago but today i got a dream which just remembered the thing]

(fir)

Re: gpu extension to c

<cdd4a111-34a4-499b-9e86-7e2e179edf7en@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18354&group=comp.lang.c#18354

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a37:9b16:: with SMTP id d22mr17592666qke.22.1632176166096;
Mon, 20 Sep 2021 15:16:06 -0700 (PDT)
X-Received: by 2002:a0c:b44f:: with SMTP id e15mr28111421qvf.32.1632176165945;
Mon, 20 Sep 2021 15:16:05 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Mon, 20 Sep 2021 15:16:05 -0700 (PDT)
In-Reply-To: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.223; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.223
References: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <cdd4a111-34a4-499b-9e86-7e2e179edf7en@googlegroups.com>
Subject: Re: gpu extension to c
From: profesor...@gmail.com (fir)
Injection-Date: Mon, 20 Sep 2021 22:16:06 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 72
 by: fir - Mon, 20 Sep 2021 22:16 UTC

poniedziałek, 20 września 2021 o 21:12:20 UTC+2 fir napisał(a):
> example:
>
> int image[1024][1024];
>
> video int image_in[1024][1024];
> video int image_out[1024][1024];
>
> video void BlurImageOnMpu( int current_channel_id ) by 1048576 channels
> {
> int id_x = current_channel_id%1024;
> int id_y = current_channel_id/1024;
> int value;
> if(id_x==0) value = ( image_in[id_y][id_x] + image_in[id_y][id_x+1] ) /2;
> else if(id_x==1023) value = ( image_in[id_y][id_x] + image_in[id_y][id_x-1] ) /2;
> else
> value = (image_in[id_y][id_x-1] + image_in[id_y][id_x] + image_in[id_y][id_x+2]) / 3 ;
> //i know its nonsense coz its rgb not integer but for illistratuon of idea
> image_out[id_y][id_x] = value;
> }
> int main()
> {
> load_image("some.jpg", image);
> copy_ram_to_vram(image_in, image, 1024*1024);
> BlurImageOnMpu();
> copy_vram_to_ram(image, image_out, 1024*1024);
> save_image("some out.jpg", image);
> return 1;
> }
>
> i was sleeping today and dreamin about writing gpu kernells stright form c language level.. (later i also reneme gpu as mpu = matrix processing unit as this name is more general)
> it seem to me that only slight extension to c syntax need to be added mainly some keyword "video" or "mpu" which would denote that tis entity is to be lockated in vram not ram and this funstion is gpu kernel function not regular cpu one.. i use "video" keyword just to be more eye catching here
> the code example is a intentiionally bit simplified for fixed image size and idiotic 'blur' code when i add argb pixels which is nonsense but it is to ilustrate c extension not to use real sense function whuch would be harder to read
> beside "video" keyword one also need to dentote on how many parallel gpu/mpu/video channels given kernel function would be run - i use "by 1048576 parallel channels" stetement which is a bit long and also kinda syntactic stub,. it could be something else like [1048576] after function name or somethnig
> not not that i got this idea in dream, i was thinkiong on this some years ago but today i got a dream which just remembered the thing]
>
> (fir)

btw i remember once navia or somebody was sending some proposals to c standarisation comitee (or am i wrong?)

the comitee it doing some slight nonsenses etc and this is an extension that could change a lot
(here the extensions it to add that one ketword to denote gpu ram and gpoy function/kernel and
other is this "by 10000000" whicgh denotes on how many channels run that kernel

if someone would like to sent this as an official proposition it may send it but only need to add "ass proposed by user fir on comp.lang.c " etc ;c ..eventually some could also consult with me the text of this proposition

imagine how much it would change if c compilers like gcc would later support it and being able to run gpu codes on the fly with ease

Re: gpu extension to c

<sj9dsp$b0i$1@solani.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18501&group=comp.lang.c#18501

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!weretis.net!feeder8.news.weretis.net!reader5.news.weretis.net!news.solani.org!.POSTED!not-for-mail
From: pkk...@spth.de (Philipp Klaus Krause)
Newsgroups: comp.lang.c
Subject: Re: gpu extension to c
Date: Sat, 2 Oct 2021 12:56:24 +0200
Message-ID: <sj9dsp$b0i$1@solani.org>
References: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 2 Oct 2021 10:56:25 -0000 (UTC)
Injection-Info: solani.org;
logging-data="11282"; mail-complaints-to="abuse@news.solani.org"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:Q+a7VoH997k1imQDHODkTPrg0N0=
Content-Language: en-US
In-Reply-To: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
X-User-ID: eJwNwYkRwDAIA7CV+EzoOBwx+4+QSvDUnBOJDCyWt9TDnAXofBRyaVSHCK731GrPKNry/B4cPRD8
 by: Philipp Klaus Krause - Sat, 2 Oct 2021 10:56 UTC

There are GPU experts that put a lot of effort into adapting C for GPUs
/ making a C-like language for GPUs.
The result was OpenCL 1.0, based on ISO C99. AFAIR, since OpenCL 2.0 it
is based on ISO C11, since OpenCL 3.0 on ISO C17.

Re: gpu extension to c

<85c13845-dada-464b-ac92-0967a5cbf994n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18517&group=comp.lang.c#18517

  copy link   Newsgroups: comp.lang.c
X-Received: by 2002:a0c:ca0e:: with SMTP id c14mr15473911qvk.52.1633213481121;
Sat, 02 Oct 2021 15:24:41 -0700 (PDT)
X-Received: by 2002:a37:9ec6:: with SMTP id h189mr3959414qke.28.1633213480975;
Sat, 02 Oct 2021 15:24:40 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.c
Date: Sat, 2 Oct 2021 15:24:40 -0700 (PDT)
In-Reply-To: <sj9dsp$b0i$1@solani.org>
Injection-Info: google-groups.googlegroups.com; posting-host=5.172.255.185; posting-account=Sb6m8goAAABbWsBL7gouk3bfLsuxwMgN
NNTP-Posting-Host: 5.172.255.185
References: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com> <sj9dsp$b0i$1@solani.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <85c13845-dada-464b-ac92-0967a5cbf994n@googlegroups.com>
Subject: Re: gpu extension to c
From: profesor...@gmail.com (fir)
Injection-Date: Sat, 02 Oct 2021 22:24:41 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 21
 by: fir - Sat, 2 Oct 2021 22:24 UTC

sobota, 2 października 2021 o 12:56:38 UTC+2 Philipp Klaus Krause napisał(a):
> There are GPU experts that put a lot of effort into adapting C for GPUs
> / making a C-like language for GPUs.
> The result was OpenCL 1.0, based on ISO C99. AFAIR, since OpenCL 2.0 it
> is based on ISO C11, since OpenCL 3.0 on ISO C17.

they made efforts to define c-like language to shape gpu computiung in kind of c-like code which is run on gpu...but here im talking about somethingthey not done as far as i know

if you want to write and execute gpu code as far as i know (i say afaik as i compiled soem examplec in opencl but not many and few years ago) you must put that c-like gpu-kernel code in a string of chars and then set it to being compiled by opencl then after compiling you may run it you also need to setup arguments by calling opencl finctons etc...this all setup and 'sewing' code is long and kinda ugly - the idea is to remove it and use only one or two keywords making c support it on language level - that kind of c would be compiled on two targets cpu and gpu but being 'glued' begind the language scenes by compiler .. i gabe example how it can look

Re: gpu extension to c

<9986J.143439$rl3.54726@fx45.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=18523&group=comp.lang.c#18523

  copy link   Newsgroups: comp.lang.c
Path: rocksolid2!news.neodome.net!feeder1.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!news-out.netnews.com!newsin.alt.net!fdcspool1.netnews.com!news-out.netnews.com!news.alt.net!fdc2.netnews.com!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx45.iad.POSTED!not-for-mail
Newsgroups: comp.lang.c
From: branimir...@icloud.com (Branimir Maksimovic)
Subject: Re: gpu extension to c
References: <b5413da6-f4d3-4552-ad5f-2a7fc481e8b8n@googlegroups.com>
<sj9dsp$b0i$1@solani.org>
<85c13845-dada-464b-ac92-0967a5cbf994n@googlegroups.com>
User-Agent: slrn/1.0.3 (Darwin)
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Lines: 30
Message-ID: <9986J.143439$rl3.54726@fx45.iad>
X-Complaints-To: abuse@usenet-news.net
NNTP-Posting-Date: Sun, 03 Oct 2021 02:00:37 UTC
Organization: usenet-news.net
Date: Sun, 03 Oct 2021 02:00:37 GMT
X-Received-Bytes: 2257
 by: Branimir Maksimovic - Sun, 3 Oct 2021 02:00 UTC

On 2021-10-02, fir <profesor.fir@gmail.com> wrote:
> sobota, 2 października 2021 o 12:56:38 UTC+2 Philipp Klaus Krause napisał(a):
>> There are GPU experts that put a lot of effort into adapting C for GPUs /
>> making a C-like language for GPUs. The result was OpenCL 1.0, based on ISO
>> C99. AFAIR, since OpenCL 2.0 it is based on ISO C11, since OpenCL 3.0 on ISO
>> C17.
>
> they made efforts to define c-like language to shape gpu computiung in kind
> of c-like code which is run on gpu...but here im talking about somethingthey
> not done as far as i know
>
> if you want to write and execute gpu code as far as i know (i say afaik as i
> compiled soem examplec in opencl but not many and few years ago) you must put
> that c-like gpu-kernel code in a string of chars and then set it to being
> compiled by opencl then after compiling you may run it you also need to setup
> arguments by calling opencl finctons etc...this all setup and 'sewing' code
> is long and kinda ugly - the idea is to remove it and use only one or two
> keywords making c support it on language level - that kind of c would be
> compiled on two targets cpu and gpu but being 'glued' begind the language
> scenes by compiler .. i gabe example how it can look
Learn to use proper news reader and how to poperly format text,
before talking anything on usenet..

--

7-77-777
Evil Sinner!
to weak you should be meek, and you should brainfuck stronger
https://github.com/rofl0r/chaos-pp

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor