Git Product home page Git Product logo

codeblogarticles's Introduction

codeblogarticles's People

Contributors

jjfumero avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

codeblogarticles's Issues

Does zeCommandQueueSynchronize synchronize on completion?

Hi Juan,

Thanks for the articles and source on getting started with Level Zero.

I noticed that you time your GPU execution from zeCommandListClose to zeCommandQueueSynchronize.

VALIDATECALL(zeCommandQueueSynchronize(cmdQueue, std::numeric_limits<uint64_t>::max()));

I think a more accurate timing would be to measure from zeCommandQueueExecuteCommandLists with a fence to zeFenceHostSynchronize (see example here).

I've only just started to look at Level Zero and I'm not even familiar with Vulkan, but IIUC zeCommandQueueSynchronize just guarantees that the command queue has 'shipped' and is ready for reuse. It does not guarantee that execution on the GPU has completed.

I noticed that host-synchronizing on an event without synchronizing the command queue first gives an error. So I'm a little surprised about the example linked above which does not seem to require queue synchronization for fences.

Improvements to your github article on level0 zeMemAllocShared

Thank you for the write up. In your article, when you initialize Level Zero structures, you do not initialize certain fields. in particular, pnext as shown here:

ze_context_desc_t contextDescription = {};
contextDescription.stype = ZE_STRUCTURE_TYPE_CONTEXT_DESC;
contextDescription.flags = 0;

Intel compilers initialize them to 0 by default, whereas clang does not resulting in jumps based on uninitialized values and your samples crashing/hangning every now and then.

Fix:

ze_context_desc_t contextDescription = {};
contextDescription.stype = ZE_STRUCTURE_TYPE_CONTEXT_DESC;
contextDescription.flags = 0;
contextDescription.pNext = nullptr;

Incorrect kernel argument order

// from mxm.cpp
VALIDATECALL(zeKernelSetArgumentValue(kernel, 0, sizeof(dstResult), &dstResult));
VALIDATECALL(zeKernelSetArgumentValue(kernel, 1, sizeof(sharedA), &sharedA));
VALIDATECALL(zeKernelSetArgumentValue(kernel, 2, sizeof(sharedB), &sharedB));
VALIDATECALL(zeKernelSetArgumentValue(kernel, 3, sizeof(int), &items));

doesn't correspond to

// from matrixMultiply.cl
__kernel void mxm(__global int* a, __global int* b, __global int *c, const int n) {

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.