Comments (4)
Our front-end currently don't allow empty initializing arrays whose size is not known at compile time. But it seems that you can work around this by initializing the array explicitly in the entrypoint. Or you can try something like:
groupshared uint totals[workgroup_subgroups] = __makeArrayFromElement<workgroup_subgroups>(0);
__intrinsic_op(makeArrayFromElement)
Array<uint, N> __makeArrayFromElement<let N:int>(uint element);
from slang.
Note that initialization of groupshared variable is not a currently supported feature. The compiler currently generates in-efficient code in that every thread will try to assign to the variable at the begining of the entrypoint.
from slang.
If it weren't for the extern
length, the initialization would have compiled. Is the link phase (when extern
/export
is resolved) not considered compile time?
Though, as you said, it would have resulted in inefficient code. Should initialization of groupshared
memory be disallowed by default then (to avoid a potential surprise if nothing better can be done)?
(Feel free to close by the way, especially if you judge nothing is really broken here.)
from slang.
Yeah, I think we need to work on the diagnostic to disallow initialization of groupshared variables as a separate issue.
Closing this one.
from slang.
Related Issues (20)
- AD Cleanup: Fix confusing naming conventions for synthesized methods and types
- AD Cleanup: Cleanup `slang-ir-autodiff-unzip.cpp` & `slang-ir-autodiff-unzip.h`
- AD Cleanup: Avoid dealing with invalid IR by representing out-of-scope accesses through `Push` and `Pop` instructions
- Add OpCapability only once
- AD Cleanup: CFG normalization replaces break statements with a boolean break flag `bflag`, but this currently means the opposite of what it should
- AD Cleanup: break-elimination during the CFG normalization step can cause the loop condition to be evaluated an extra time.
- Lower CMake version requirement
- GLSL texture functions need to support int and uint types of samplers as well as float HOT 1
- AD Enhancement: Avoid SSA-ing aggregate types by treating pointer-based element & field accesses as if they were differentiable method calls.
- AD Enhancement: Enhance DCE to avoid situations where mutating primal methods are called multiple times during the reverse-mode pass, potentially causing slow-down
- [] operator partially supported for Texture2DMS HOT 3
- .mips operator function not supported Texture2D HOT 1
- Consider supporting #pragma pack_matrix() HOT 1
- Capability System: Profile and look into performance with larger systems
- Metal: support integer type texture HOT 1
- Fix memory leak in slang.dll HOT 3
- Create the breakdown profiling of slang HOT 2
- AD Cleanup: Use a temporary accumulation inst such as `IRAccumulate` instead of explicitly loading, adding and storing differential values in reverse mode HOT 1
- Implement metrics tracking for GitHub engagement
- Document the existing auto-diff type system, semantic checking and AST synthesis methods
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slang.