All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Samuel Pitoiset
	<samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Ilia Mirkin <imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
Cc: "nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
	<nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: Dealing with opencl kernel parameters in nouveau now that RES support is gone
Date: Mon, 22 Feb 2016 13:46:56 +0100	[thread overview]
Message-ID: <56CB0340.3010403@redhat.com> (raw)
In-Reply-To: <56CB01EB.9040705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

Hi,

On 22-02-16 13:41, Samuel Pitoiset wrote:
> Hi there,
>
> On 02/22/2016 12:26 PM, Hans de Goede wrote:

<snip>

>> So back to the problem of getting OpenCL(ish) code to work again with
>> the recent mesa changes. For starters I would like to get:
>>
>> src/gallium/tests/trivial/compute.c and then the test with mask 8,
>> test_input_global() to work again, when that is working I should be
>> able to adjust my llvm work (and if necessary clover) to start to
>> work again.
>>
>> Currently the test_input_global() test uses the following bit of
>> TGSI code:
>>
>> COMP
>> DCL SV[0], THREAD_ID[0]
>> DCL TEMP[0], LOCAL
>> DCL TEMP[1], LOCAL
>> IMM UINT32 { 8, 0, 0, 0 }
>>
>>     BGNSUB\n"
>>         UMUL TEMP[0], SV[0], IMM[0]
>>         LOAD TEMP[1].xy, RINPUT, TEMP[0]
>>         LOAD TEMP[0].x, RGLOBAL, TEMP[1].yyyy
>>         UADD TEMP[1].x, TEMP[0], -TEMP[1]
>>         STORE RGLOBAL.x, TEMP[1].yyyy, TEMP[1]
>>         RET
>>     ENDSUB
>>
>>
>> Where by RINPUT and RGLOBAL get replaces by processing the
>> code with cpp and the following defines:
>>
>> #define RGLOBAL        RES[32767]
>> #define RLOCAL         RES[32766]
>> #define RPRIVATE       RES[32765]
>> #define RINPUT         RES[32764]
>>
>> If I understand how memory is supposed to work, then I would need to
>> change the TGSI as follows:
>>
>> COMP
>> DCL SV[0], THREAD_ID[0]
>> DCL MEMORY[0]
>> DCL TEMP[0], LOCAL
>> DCL TEMP[1], LOCAL
>> IMM UINT32 { 8, 0, 0, 0 }
>>
>> BGNSUB\n"
>> UMUL TEMP[0], SV[0], IMM[0]
>> LOAD TEMP[1].xy, RINPUT, TEMP[0]
>> LOAD TEMP[0].x, MEMORY[0], TEMP[1].yyyy
>> UADD TEMP[1].x, TEMP[0], -TEMP[1]
>> STORE MEMORY[0].x, TEMP[1].yyyy, TEMP[1]
>> RET
>> ENDSUB
>
> Nope, this won't work because RINPUT is RES[32764]. And you have to remove all occurrences to RES because it's not longer supported. In my opinion, using BUFFER[0] in a first time should work. Currently, only SHARED with MEMORY is supported.

Right, as I say below "This only solves the accessing of the global memory, it does not solve
getting to the kernel input kernel parameters"

>> This assumes, that as discussed declaring memory without a , SHARED or
>> other
>> flag means the memory is global.
>>
>> So 2 questions:
>>
>> 1) Do the above changes for using the new MEMORY keyword look as intended
>> to you?
>>
>> 2) This only solves the accessing of the global memory, it does not solve
>> getting to the kernel input kernel parameters, how would I deal with
>> those ?
>
> The input kernel parameters are directly passed through a call to pipe_context::launch_grid. You just have to fill the pipe_grid_info::input array with your parameters and they will be uploaded by nvXX_compute_upload_input().

Right, the uploading side I understand, the question is how to get to them from
the compute kernel's tgsi code ?

If I understand you correctly you are suggesting to use BUFFER[0] for this,
that is fine from a nouveau point-of-view, but might be a bit nouveau
centric way of looking at things, I think a better approach would be
a separate input register-file for this, as that will be more flexible
when people try to do opencl via clang->llvm->tgsi on other GPUs.

> I will have a look at the test_input_global().

Thanks!

Regards,

Hans
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

  parent reply	other threads:[~2016-02-22 12:46 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 14:45 Dealing with opencl kernel parameters in nouveau now that RES support is gone Hans de Goede
     [not found] ` <56C5D8F9.6030408-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-18 16:39   ` Ilia Mirkin
     [not found]     ` <CAKb7UvidnYPcG4w=R=1CKhc0AFmSKzmdgYA9XAKT3sBHwnpGcw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-19 10:36       ` Hans de Goede
     [not found]         ` <56C6F031.6060308-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-19 19:43           ` Ilia Mirkin
     [not found]             ` <CAKb7UvgzKeOCm3Xh+j4=E_ru5_F_xGnx9NHkVT9sJoDw17OhVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 11:26               ` Hans de Goede
     [not found]                 ` <56CAF059.3090608-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 12:41                   ` Samuel Pitoiset
     [not found]                     ` <56CB01EB.9040705-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-22 12:46                       ` Hans de Goede [this message]
     [not found]                         ` <56CB0340.3010403-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 13:04                           ` Samuel Pitoiset
     [not found]                             ` <56CB074B.9070406-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-22 13:08                               ` Hans de Goede
     [not found]                                 ` <56CB0865.7070108-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 13:45                                   ` Ilia Mirkin
     [not found]                                     ` <CAKb7UvgZoRLeLhnqa-H6bLG+gyLRYj+arCNQP39Q8zPR6Gu4jA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 13:47                                       ` Ilia Mirkin
     [not found]                                         ` <CAKb7UviPZtExOcgUDxuxyhGf6C0QL+apn6ZjJEdJ8DhM_sfChw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 14:17                                           ` Hans de Goede
     [not found]                                             ` <56CB1870.4030606-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 14:22                                               ` Ilia Mirkin
2016-02-22 14:50                                                 ` Hans de Goede
     [not found]                                                   ` <56CB2031.1050507-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 15:24                                                     ` Ilia Mirkin
     [not found]                                                       ` <CAKb7UvgjtVfYZR2hW_bttjmyVFa0kDGW7ZejS+j-MVsxcnwNoQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 15:50                                                         ` Hans de Goede
     [not found]                                                           ` <56CB2E42.60905-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 16:00                                                             ` Ilia Mirkin
     [not found]                                                               ` <CAKb7Uvjd0zNyKLri+h4O-h2Wcb1pLc3_B27+MYz-VHgf3z+1Pg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 16:07                                                                 ` Pierre Moreau
     [not found]                                                                   ` <1804001255.101474107.1456157248410.JavaMail.root-x5ewXQG5twBsFmKuirFwRhh1pbbyJDp15NbjCUgZEJk@public.gmane.org>
2016-02-22 16:11                                                                     ` Ilia Mirkin
2016-02-22 16:13                                                                 ` Ilia Mirkin
     [not found]                                                                   ` <CAKb7UviNRmhSQUOkKvQqDipcQFjxep8S2m-QRreRsWVWf8tHSg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-22 16:50                                                                     ` Hans de Goede
     [not found]                                                                       ` <56CB3C6F.7070907-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-22 16:59                                                                         ` Ilia Mirkin
     [not found]                                                                           ` <CAKb7UvhxMakSzgVzqgxSJ7J641_MaP=3nEqnX7xRANiv3M7FWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-02-23 10:43                                                                             ` Hans de Goede
     [not found]                                                                               ` <56CC37EA.3030703-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-02-23 12:12                                                                                 ` Pierre Moreau
     [not found]                                                                                   ` <20160223121211.GA3402-V5oniRM6A16axBhUmp6zfjAV6s6igYVG@public.gmane.org>
2016-02-23 20:36                                                                                     ` Ilia Mirkin
2016-02-22 15:15                                                 ` Pierre Moreau
     [not found]                                                   ` <D759423A-B76C-49C9-AB83-5B431C43ECC5-GANU6spQydw@public.gmane.org>
2016-02-22 15:26                                                     ` Ilia Mirkin
2016-02-22 14:42                                   ` Samuel Pitoiset
     [not found]                                     ` <56CB1E49.5000805-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-02-22 14:53                                       ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56CB0340.3010403@redhat.com \
    --to=hdegoede-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org \
    --cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=samuel.pitoiset-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.