Giter Club home page Giter Club logo

Comments (6)

doe300 avatar doe300 commented on June 12, 2024 1

In general, you can query Local#getUsers(LocalUse::Type::WRITER) to get all writers.

If there is just one writer, Local#getSingleWriter() will do the trick. Also if you have a Value instead of the local, you can call Value#getSingleWriter() which does the same, but checks whether the value is a local. Of course the result needs to be checked for nullptr in both cases!

from vc4c.

doe300 avatar doe300 commented on June 12, 2024

There is already some related code there. This was added some while ago to do a similar job, but I am not sure whether it is still applied. Anyway, that might be a good point to start.

from vc4c.

long-long-float avatar long-long-float commented on June 12, 2024

@doe300 I have a question. Is there a way to find the instruction corresponded the local (for example, I want to get the instruction %sub1 = sub i32 %mul, %width from the value i32 %sub1). Or should I create this method?

%mul = mul nsw i32 %y.024, %width
%sub1 = sub i32 %mul, %width
%add = add i32 %mul, %width

%call = tail call spir_func <16 x i8> @_Z7vload16jPU3AS1Kh(i32 %sub1, i8 addrspace(1)* %in) #2
%call2 = tail call spir_func <16 x i8> @_Z7vload16jPU3AS1Kh(i32 %mul, i8 addrspace(1)* %in) #2
%call3 = tail call spir_func <16 x i8> @_Z7vload16jPU3AS1Kh(i32 %add, i8 addrspace(1)* %in) #2

from vc4c.

long-long-float avatar long-long-float commented on June 12, 2024

@doe300 I want to insert the instruction (extends IntermediateInstruction) which do VPM load here, but I cannot find it.
Is there such the instruction, or should I create the instruction?

from vc4c.

doe300 avatar doe300 commented on June 12, 2024

The general memory access (before we know whether the memory area is lowered to a register, the VPM or accessed via TMU or DMA) is represented as MemoryInstruction.
After the lowering, there are no specific instruction types for the various lowered types (e.g. register, VPM), instead the MemoryInstruction is directly composed to the (hardware) instructions executed to do the memory accesses.
So if you want to insert a VPM access, have a look at the VPM header:

  • insertReadDMA, insertWriteDMA for "direct" DMA access (QPU <-> RAM), abstracting away the VPM
  • VPM::insertReadVPM, VPM::insertWriteVPM for VPM access (QPU <-> VPM), e.g. also for caching/exchanging data between QPUs
  • VPM::insertReadRAM, VPM::insertWriteRAM for DMA only access (VPM <-> RAM), e.g. to read/write back cached data

The VPM object required can be retrieved via the Method::vpm member.

Does this information suffice or do you need a special instruction type to represent VPM accesses (e.g. for further processing)?

from vc4c.

long-long-float avatar long-long-float commented on June 12, 2024

I understand, thanks.

from vc4c.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.