Nine compute kernels from the dasLLAMA test suite (daslang-generated SPIR-V, disassembled
with spirv-dis; spirv-as rebuilds the binaries). All nine pass spirv-val (default and
--target-env vulkan1.2). On Apple M1 Max, macOS 26.5.2, MoltenVK 1.4.2 (brew), with
Metal argument buffers enabled (MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=1, the Apple
Silicon default) the seven kernels marked FAIL dispatch without any error but none of
their device stores land; with MVK_CONFIG_USE_METAL_ARGUMENT_BUFFERS=0 all nine produce
correct results. Fences signal and buffer copies in the same submission run in both cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // this will split the work between all available threads | |
| // if chunk_count is -1, default number of chunks will be computed | |
| void JobQue::parallel_for ( int from, int to, const JobChunk & chunk, int chunk_count, int step ) | |
| { | |
| if ( from >= to ) | |
| return; | |
| // so the idea here is that if say 1 thread is busy | |
| // we don't pay 2x time. smaller chunks are more evenly distributed | |
| if ( chunk_count==-1 ) | |
| chunk_count = mThreadCount * 4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mat3 cotangent_frame( vec3 N, vec3 p, vec2 uv ) | |
| { | |
| // get edge vectors of the pixel triangle | |
| vec3 dp1 = dFdx( p ); | |
| vec3 dp2 = dFdy( p ); | |
| vec2 duv1 = dFdx( uv ); | |
| vec2 duv2 = dFdy( uv ); | |
| // solve the linear system | |
| vec3 dp2perp = cross( dp2, N ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /////////////////////////////////////////// | |
| // parse library_visual_scenes (nodes) here | |
| void importDaeNodeArray ( const pugi::xpath_node_set & nodes, vector<NodePtr> & outNodes, const WeakNodePtr & parent ) | |
| { | |
| using namespace pugi; | |
| if ( nodes.size()==0 ) | |
| return; | |
| outNodes.resize(nodes.size()); | |
| for ( unsigned int ni=0; ni<nodes.size(); ni++ ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vec3 finalColor = vec3( 0.0 ); | |
| float steps = 0.0; | |
| int initialSteps = max ( 4, g_Steps / 3 ); | |
| int maxEstSteps = 32; | |
| float kFactor = 2.0 / g_Steps; | |
| // do initial steps | |
| for ( int i=0; i<initialSteps; ++i ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| vec3 finalColor = vec3( 0.0 ); | |
| float steps = 0.0; | |
| int initialSteps = max ( 4, g_Steps / 3 ); | |
| int maxEstSteps = 32; | |
| float factor = max ( 1.0, length(g_light_color.rgb)/length(vec3(1.0)) ); | |
| float tolerance = 1.0 / ( (g_Steps * 4.0 + initialSteps) * factor ); | |
| // do initial steps | |
| for ( int i=0; i<initialSteps; ++i ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <functional> | |
| #include <initializer_list> | |
| #define USE_EMPLACE 1 | |
| #define USE_UREF 1 | |
| using namespace std; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Report | |
| { | |
| public: | |
| Report() : i_am_dead(false) { cout << " Report();" << endl; } | |
| Report(const Report & ) { cout << " Report(const Report&);" << endl; }; | |
| Report(Report && h) { cout << " Report(&&);" << endl; h.i_am_dead = true; } | |
| Report & operator = (const Report&) { cout << " Report::=(const Report&);" << endl; return *this; }; | |
| ~Report() { cout << " ~Report() i_am_dead=" << i_am_dead << endl; } | |
| bool i_am_dead; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Report | |
| { | |
| public: | |
| Report() { cout << "Report();" << endl; } | |
| Report(const Report & ) { cout << "Report(const & Report);" << endl; }; | |
| Report(Report &&) { cout << "Report(&&);" << endl; } | |
| Report & operator = (const Report &) { cout << "Report::=(const Report &);" << endl; return *this; }; | |
| }; | |
| template <typename Tc, typename T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <vector> | |
| #include <functional> | |
| #include <initializer_list> | |
| #include <string> | |
| using namespace std; | |
| template <typename TT> | |
| class RArray : protected vector<TT> |
NewerOlder