January 09, 2012
On Mon 09-Jan 0:05, Trass3r wrote:
>> About the 'mentioned bugfix', I assume you're referring to "bug 6473
>> has been fixed => so let's fix that memory leak"?
>
> Yep, just git checkout the revision before that one.


Ok, so when i try to compile it says

src\opencl\c\cl_d3d10.d(88): Error: undefined identifier UINT
src\opencl\c\cl_d3d10.d(96): Error: undefined identifier UINT

and upon changing those to uint I get

src\opencl\c\cl_d3d11.d(77): Error: undefined identifier ID3D11Buffer
src\opencl\c\cl_d3d11.d(84): Error: undefined identifier ID3D11Texture2D
src\opencl\c\cl_d3d11.d(91): Error: undefined identifier ID3D11Texture3D

What am I missing?
January 09, 2012
> Ok, so when i try to compile it says
>
> src\opencl\c\cl_d3d10.d(88): Error: undefined identifier UINT
> src\opencl\c\cl_d3d10.d(96): Error: undefined identifier UINT
>
> and upon changing those to uint I get
>
> src\opencl\c\cl_d3d11.d(77): Error: undefined identifier ID3D11Buffer
> src\opencl\c\cl_d3d11.d(84): Error: undefined identifier ID3D11Texture2D
> src\opencl\c\cl_d3d11.d(91): Error: undefined identifier ID3D11Texture3D
>
> What am I missing?

Well the DirectX stuff isn't tested at all.
I always compile with rdmd so these modules aren't compiled.
The uint errors are small cases I overlooked.
The rest is obvious: cl4d knows nothing about DirectX, so you need a binding.

Maybe I should just turn these into void* to get rid of the errors, but then you loose type safety, hmm.
January 09, 2012
On Mon 09-Jan 2:45, Trass3r wrote:
>> Ok, so when i try to compile it says
>>
>> src\opencl\c\cl_d3d10.d(88): Error: undefined identifier UINT
>> src\opencl\c\cl_d3d10.d(96): Error: undefined identifier UINT
>>
>> and upon changing those to uint I get
>>
>> src\opencl\c\cl_d3d11.d(77): Error: undefined identifier ID3D11Buffer
>> src\opencl\c\cl_d3d11.d(84): Error: undefined identifier ID3D11Texture2D
>> src\opencl\c\cl_d3d11.d(91): Error: undefined identifier ID3D11Texture3D
>>
>> What am I missing?
>
> Well the DirectX stuff isn't tested at all.
> I always compile with rdmd so these modules aren't compiled.
> The uint errors are small cases I overlooked.
> The rest is obvious: cl4d knows nothing about DirectX, so you need a
> binding.
>
> Maybe I should just turn these into void* to get rid of the errors, but
> then you loose type safety, hmm.

Well, I resorted to using bud and managed to get the vectorAdd example to compile, but when I run I get this error:

AMD Accelerated Parallel Processing
        Advanced Micro Devices, Inc.
        OpenCL 1.1 AMD-APP (831.4)
        FULL_PROFILE
        cl_khr_icd cl_amd_event_callback cl_amd_offline_devices cl_khr_d3d10_sharing
Barts
        Advanced Micro Devices, Inc.
        CAL 1.4.1646 (VM)
        OpenCL 1.1 AMD-APP (831.4)
        FULL_PROFILE
Intel(R) Core(TM)2 Duo CPU     E6750  @ 2.66GHz
        GenuineIntel
        2.0
        OpenCL 1.1 AMD-APP (831.4)
        FULL_PROFILE
Warnings being treated as errors
C:\Users\abc\AppData\Local\Temp\OCLA2DA.tmp.cl(1): error: unrecognized
          character escape sequence
  #line 35 "src\main.d"
               ^

1 error detected in the compilation of "C:\Users\abc\AppData\Local\Temp\OCLA2DA.tmp.cl".

Internal error: clc compiler invocation failed.

core.exception.AssertError@src\opencl\kernel.d(196): _object is null
----------------
42A6A8
42A51F
4039CD
40EE7C
40EEC0
40EAB7
4AC3A9
----------------

Is this some kind of \ vs / bug?
January 09, 2012
> Well, I resorted to using bud and managed to get the vectorAdd example to compile, but when I run I get this error:

btw, bud's not maintained anymore.

> Is this some kind of \ vs / bug?

Try removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO) ~ @ vectorAdd.d(36)
January 09, 2012
On Mon 09-Jan 14:24, Trass3r wrote:
>> Well, I resorted to using bud and managed to get the vectorAdd example
>> to compile, but when I run I get this error:
>
> btw, bud's not maintained anymore.
>
>> Is this some kind of \ vs / bug?
>
> Try removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO) ~ @ vectorAdd.d(36)

Alright, that works! The vector example now gives the expected output.
The CLGLInterop example however just gives a black window.
By the way, just using your make.bat (with -d added) compiles fine now too.
January 09, 2012
On Mon 09-Jan 23:39, Klyn wrote:
> On Mon 09-Jan 14:24, Trass3r wrote:
>>> Well, I resorted to using bud and managed to get the vectorAdd example
>>> to compile, but when I run I get this error:
>>
>> btw, bud's not maintained anymore.
>>
>>> Is this some kind of \ vs / bug?
>>
>> Try removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO) ~ @ vectorAdd.d(36)
>
> Alright, that works! The vector example now gives the expected output.
> The CLGLInterop example however just gives a black window.
> By the way, just using your make.bat (with -d added) compiles fine now too.

I finally compiled the HEAD dmd/druntime/phobos, so I'm now using your latest cl4d version. The make.bat compiles both examples just fine (with -d ofcourse).
The vectorAdd example works perfectly, without any editing (ie. without removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO)).
The CLGLInterop example however still just gives a black window. It only outputs the FPS in cmdline.
January 10, 2012
> The vectorAdd example works perfectly, without any editing (ie. without removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO)).

How strange, does pragma(msg, CL_PROGRAM_STRING_DEBUG_INFO); give different results for the two dmd revisions?

> The CLGLInterop example however still just gives a black window. It only outputs the FPS in cmdline.

any error messages?
compile it in debug mode with -debug -g.
January 10, 2012
On Tue 10-Jan 1:23, Trass3r wrote:
>> The vectorAdd example works perfectly, without any editing (ie.
>> without removing the mixin(CL_PROGRAM_STRING_DEBUG_INFO)).
>
> How strange, does pragma(msg, CL_PROGRAM_STRING_DEBUG_INFO); give
> different results for the two dmd revisions?
>
>> The CLGLInterop example however still just gives a black window. It
>> only outputs the FPS in cmdline.
>
> any error messages?
> compile it in debug mode with -debug -g.

None that I can see.

C:\cl4d\CLGLInterop.exe
copied cl_platform_id 920C4F4. Reference count is now: 0
wrapped cl_context A5671A8
releasing cl_platform_id 920C4F4. Reference count before: 0
copied cl_platform_id 920C4F4. Reference count is now: 0
releasing cl_platform_id 920C4F4. Reference count before: 0
copied cl_context A5671A8. Reference count is now: 2
wrapped cl_mem A5789A8
releasing cl_context A5671A8. Reference count before: 2
copied cl_mem A5789A8. Reference count is now: 2
releasing cl_mem A5789A8. Reference count before: 2
copied cl_context A5671A8. Reference count is now: 2
wrapped cl_mem A49F8C8
releasing cl_context A5671A8. Reference count before: 2
copied cl_mem A49F8C8. Reference count is now: 2
releasing cl_mem A49F8C8. Reference count before: 2
copied cl_context A5671A8. Reference count is now: 2
wrapped cl_mem 44EEC38
releasing cl_context A5671A8. Reference count before: 2
copied cl_context A5671A8. Reference count is now: 2
wrapped cl_program A642850
releasing cl_context A5671A8. Reference count before: 3
copied cl_program A642850. Reference count is now: 2
copied cl_device_id 44276B0. Reference count is now: 0
releasing cl_device_id 44276B0. Reference count before: 0
releasing cl_program A642850. Reference count before: 2
copied cl_program A642850. Reference count is now: 2
wrapped cl_kernel A608008
releasing cl_program A642850. Reference count before: 3
copied cl_mem A5789A8. Reference count is now: 2
copied cl_mem A49F8C8. Reference count is now: 2
copied cl_mem 44EEC38. Reference count is now: 2
copied cl_mem A5789A8. Reference count is now: 3
copied cl_mem A5789A8. Reference count is now: 4
releasing cl_mem A5789A8. Reference count before: 4
releasing cl_mem A5789A8. Reference count before: 3
copied cl_mem A49F8C8. Reference count is now: 3
copied cl_mem A49F8C8. Reference count is now: 4
releasing cl_mem A49F8C8. Reference count before: 4
releasing cl_mem A49F8C8. Reference count before: 3
copied cl_mem 44EEC38. Reference count is now: 3
copied cl_mem 44EEC38. Reference count is now: 4
releasing cl_mem 44EEC38. Reference count before: 4
releasing cl_mem 44EEC38. Reference count before: 3
releasing cl_mem A5789A8. Reference count before: 2
releasing cl_mem A49F8C8. Reference count before: 2
releasing cl_mem 44EEC38. Reference count before: 2
copied cl_context A5671A8. Reference count is now: 3
copied cl_device_id 44276B0. Reference count is now: 0
wrapped cl_command_queue 4436648
releasing cl_context A5671A8. Reference count before: 4
releasing cl_device_id 44276B0. Reference count before: 0
copied cl_device_id 44276B0. Reference count is now: 0
releasing cl_device_id 44276B0. Reference count before: 0
releasing cl_program A642850. Reference count before: 2
initialization done
copied cl_mem A5789A8. Reference count is now: 2
copied cl_mem A49F8C8. Reference count is now: 2
wrapped cl_event A5594C0
copied cl_mem A5789A8. Reference count is now: 4
releasing cl_mem A5789A8. Reference count before: 3
copied cl_mem A49F8C8. Reference count is now: 4
releasing cl_mem A49F8C8. Reference count before: 3
releasing cl_event A5594C0. Reference count before: 2
copied cl_mem 44EEC38. Reference count is now: 2
wrapped cl_event 442DFE0
releasing cl_mem 44EEC38. Reference count before: 2
releasing cl_event 442DFE0. Reference count before: 1
etc.
January 10, 2012
>>> The CLGLInterop example however still just gives a black window. It only outputs the FPS in cmdline.
>>
>> any error messages?
>> compile it in debug mode with -debug -g.
>
> None that I can see.

Hmm I'm not sure if I ever tested the code on Windows. The version(Windows) stuff looks ok though.
I guess one would have to investigate this with something like http://www.gremedy.com
January 10, 2012
Does this one work?
http://www.cmsoft.com.br/index.php?option=com_content&view=category&layout=blog&id=99&Itemid=150