Skip Navigation
camelcdr camel-cdr @beehaw.org
Posts 20
Comments 5

I created this with a few friends a while ago, though I might share it here

0
Challenge: Function that prints a `n` big tree
  • very cool, but you forgot the trunk

  • Challenge: Function that prints a n big tree

    Write a function that prints an n big tree, e.g. for n=5:

    ``` * * *

      | | ```

    Here is what I came up with in C:

    ```c N,i;a(n){for(i=N=N?N:n+2;i--;printf(i?"* "+(N-n-1<i):--n?"\n":"\n%*s",N,"| |"));n&&a(n);}

    // the invocation isn't part of the golf: main(){a(5);} ```

    PS: Code blocks currently wrap around when they are too long, I've already submitted a patch to make them scroll horizontally instead.

    18

    Why are RISC-V Immediates so weird? [Video]

    Not mine, I just found it on YouTube.

    0
    m.youtube.com MILLIONS of early RISCV CPUs ship with an INCOMPATIBLE VECTOR extensions probably nobody will use!

    Turns out the Alibaba/T-Head C906 #RISCV core with Vector extension implements an early 0.7 draft revision and is mostly incompatible with the final 1.0 revi...

    MILLIONS of early RISCV CPUs ship with an INCOMPATIBLE VECTOR extensions probably nobody will use!

    I think it's fine that rvv 0.7.1 isn't included in the official toolchains anymore.

    As fun as it is to play around with rvv on those chips, I see those as development devices and no normal user should enable the vector extension there anyways.

    I'd also rather the clang team puts some work into finally eliminating redundant vscale load/stores (this is THE thing that's stopping rvv ports for things like SIMDe), then adding rvv 0.7.1 support.

    0
    Community Request Thread
  • I'm not a local programming.dev resident, but I'd be interested in a code golf community.

    It could be really fun to host/participate in challenge threads, and posts about some fun golfs.

  • How I program C
  • That's one of my favorite C videos.

  • (C++) Does anyone know the difference between Critical sections and Reduction in OpenMP?
  • The critical section makes sure that only ever a single thread can execute the section at a time. So when a thread what's to execute the section, it first needs to make sure no other thread is executing it and potentially wait for the other threads to finish executing the section.

    Reductions however don't induce this synchronization overhead, instead each thread executes with an independent parent value, and after the loop is done, the reduction is applied to merge all parent values. The following, is essentially what the #pragma omp parallel for reduction(min : parent) is equivalent to:

    unsigned int parents[8] = {v, v, v, v, v, v, v, v};
    
    #pragma omp parallel for num_threads(8)
    for(unsigned int j = 0; j < G.Out[v]._map.bucket_count(); j++) {
    	for(auto ite = G.Out[v]._map.begin(j); ite != G.Out[v]._map.end(j); ite++) {
    		unsigned int w = ite->first;
    		if(v > w)
    			parents[omp_get_thread_num()] = min(parents[omp_get_thread_num()],w);
    	}
    }
    
    unsigned int parent = v;
    for (unsigned int i = 0; i < 8; ++i) {
    	parent = min(parent, parents[i]);
    }
    
  • Red and Anarchist Black Metal @sh.itjust.works camel-cdr @beehaw.org

    Gravpel - Power to the Filthy Masses

    0

    Enable rvv on MangoPi MQ-Pro (Allwinner D1) Linux

    github.com rvv-d1/README.md at main · camel-cdr/rvv-d1

    Enable rvv on MangoPi MQ-Pro (Allwinner D1) linux. Contribute to camel-cdr/rvv-d1 development by creating an account on GitHub.

    rvv-d1/README.md at main · camel-cdr/rvv-d1
    0
    How do you discover new music
  • I mainly use metal-archives and bandcamp. On metal-archives, I mainly use the similar artists feature, and sometimes search for specific genres from specific countries.