Re: Raspberry Pi 4: Where to put raylib after I've compiled it to get dub to find and link properly

2021-03-07 Thread Mike Parker via Digitalmars-d-learn
On Monday, 8 March 2021 at 03:16:40 UTC, Decabytes wrote: I just downloaded Raylib on the pi 4, which unfortunately wasn't in the repo on Raspberry Pi OS. On my computer main comp, I can link it by just adding raylib to the libs section of the dub.sdl because I downloaded it from the repo, but

Raspberry Pi 4: Where to put raylib after I've compiled it to get dub to find and link properly

2021-03-07 Thread Decabytes via Digitalmars-d-learn
I just downloaded Raylib on the pi 4, which unfortunately wasn't in the repo on Raspberry Pi OS. On my computer main comp, I can link it by just adding raylib to the libs section of the dub.sdl because I downloaded it from the repo, but because I've compiled it from source on the RPI that

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread tsbockman via Digitalmars-d-learn
On Sunday, 7 March 2021 at 22:54:32 UTC, tsbockman wrote: ... result = diffSq[0]; static foreach(i; 0 .. 3) result += diffSq[i]; ... Oops, that's supposed to say `i; 1 .. 3`. Fixed: import std.meta : Repeat; void euclideanDistanceFixedSizeArray(V)(ref Repeat!(3, const(V)) a,

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread tsbockman via Digitalmars-d-learn
On Sunday, 7 March 2021 at 22:54:32 UTC, tsbockman wrote: import std.meta : Repeat; void euclideanDistanceFixedSizeArray(V)(ref Repeat!(3, const(V)) a, ref Repeat!(3, const(V)) b, out V result) if(is(V : __vector(float[length]), size_t length)) ... Resulting asm with is(V ==

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread tsbockman via Digitalmars-d-learn
On Sunday, 7 March 2021 at 18:00:57 UTC, z wrote: On Friday, 26 February 2021 at 03:57:12 UTC, tsbockman wrote: static foreach(size_t i; 0 .. 3/+typeof(a).length+/){ distance += a[i].abs;//abs required by the caller (a * a) above is always positive for real numbers. You don't need

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread tsbockman via Digitalmars-d-learn
On Sunday, 7 March 2021 at 13:26:37 UTC, z wrote: On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: However, AVX512 support seems limited to being able to use the 16 other YMM registers, rather than using the same code template but changed to use ZMM registers and double the offsets to

Re: Visual Studio 2019

2021-03-07 Thread Siemargl via Digitalmars-d-learn
On Sunday, 7 March 2021 at 20:43:22 UTC, Alexey wrote: Does Visual Studio 2019 support D development? If yes, please give me instructions on how to work in this environment. Visual D https://forum.dlang.org/thread/s1kuna$geb$1...@digitalmars.com

Visual Studio 2019

2021-03-07 Thread Alexey via Digitalmars-d-learn
Does Visual Studio 2019 support D development? If yes, please give me instructions on how to work in this environment.

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread Bruce Carneal via Digitalmars-d-learn
On Sunday, 7 March 2021 at 14:15:58 UTC, z wrote: On Thursday, 25 February 2021 at 14:28:40 UTC, Guillaume Piolat wrote: On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: How does one optimize code to make full use of the CPU's SIMD capabilities? Is there any way to guarantee that

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread z via Digitalmars-d-learn
On Friday, 26 February 2021 at 03:57:12 UTC, tsbockman wrote: static foreach(size_t i; 0 .. 3/+typeof(a).length+/){ distance += a[i].abs;//abs required by the caller (a * a) above is always positive for real numbers. You don't need the call to abs unless you're trying to guarantee

Re: How to get output of piped process?

2021-03-07 Thread Jesse Phillips via Digitalmars-d-learn
On Saturday, 6 March 2021 at 21:20:30 UTC, kdevel wrote: ```pipechain.d import std.stdio; import std.process; import std.conv; import std.array; import std.range; import std.algorithm; int main (string [] args) { auto p = pipe (); auto proc1 = spawnProcess (["cat"], stdin, p.writeEnd);

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread z via Digitalmars-d-learn
On Thursday, 25 February 2021 at 14:28:40 UTC, Guillaume Piolat wrote: On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: How does one optimize code to make full use of the CPU's SIMD capabilities? Is there any way to guarantee that "packed" versions of SIMD instructions will be

Re: Optimizing for SIMD: best practices?(i.e. what features are allowed?)

2021-03-07 Thread z via Digitalmars-d-learn
On Thursday, 25 February 2021 at 11:28:14 UTC, z wrote: ... It seems that using static foreach with pointer parameters exclusively is the best way to "guide" LDC into optimizing code.(using arr1[] += arr2[] syntax resulted in worse performance for me.) However, AVX512 support seems limited to

Re: dmd -> ldmd2: /usr/bin/ld.gold: error: .o: multiple definition of 'bool ldc.attributes...

2021-03-07 Thread kdevel via Digitalmars-d-learn
On Sunday, 7 March 2021 at 12:47:45 UTC, kinke wrote: [...] ./dmd -i -of=pointless.o -g -c pointless/package.d "dmd" is a symlink to /opt/ldc2/bin/ldmd2 Ah, try using `-i=-ldc` instead of `-i` alone to manually exclude the ldc.* modules from being included. Solved the issue. Many thanks!

Re: Can't I allocate at descontructor?

2021-03-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 5 March 2021 at 20:28:58 UTC, Ali Çehreli wrote: To my surprise, even though 'c' is not null below, the destructor is not executed multiple times. Hence why https://p0nce.github.io/d-idioms/#GC-proof-resource-class works as a detector of undeterminism.

Re: dmd -> ldmd2: /usr/bin/ld.gold: error: .o: multiple definition of 'bool ldc.attributes...

2021-03-07 Thread kinke via Digitalmars-d-learn
On Sunday, 7 March 2021 at 11:34:08 UTC, kdevel wrote: ./dmd -i -I=tillyscop:tillyscop/msgpack-d/src -O -g -of=localscop.o -c tillyscop/scop.d tillyscop/scopserializer.d and ./dmd -i -of=pointless.o -g -c pointless/package.d "dmd" is a symlink to /opt/ldc2/bin/ldmd2 Ah, try using `-i=-ldc`

Re: dmd -> ldmd2: /usr/bin/ld.gold: error: .o: multiple definition of 'bool ldc.attributes...

2021-03-07 Thread kdevel via Digitalmars-d-learn
On Sunday, 7 March 2021 at 11:50:45 UTC, z wrote: [...] I think i had a similar error, can you try adding version(LDC) pragma(LDC_no_moduleinfo) to the affected modules? At the line just after the module declaration, particularly in all package.d files and the file that contains the main

Re: dmd -> ldmd2: /usr/bin/ld.gold: error: .o: multiple definition of 'bool ldc.attributes...

2021-03-07 Thread z via Digitalmars-d-learn
On Saturday, 6 March 2021 at 22:14:26 UTC, kdevel wrote: After replacing dmd with ldmd2 (LDC 1.25.1) I get tons of link errors all of the form mentioned in the subject. Any idea what can be done about it? (With a handcrafted single compile/link statement using ldc2 everything compiles but

Re: dmd -> ldmd2: /usr/bin/ld.gold: error: .o: multiple definition of 'bool ldc.attributes...

2021-03-07 Thread kdevel via Digitalmars-d-learn
On Sunday, 7 March 2021 at 01:29:50 UTC, Preetpal wrote: [...] Can you post more information? Like the full error that you are seeing, [link cmd] /usr/bin/ld.gold: error: pointless.o: multiple definition of '_D3ldc10attributes10assumeUsedySQBeQBd11_assumeUsed' /usr/bin/ld.gold: localscop.o: