-
Notifications
You must be signed in to change notification settings - Fork 0
/
compute_matmul.js
4 lines (4 loc) · 2.92 KB
/
compute_matmul.js
1
2
3
4
parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"g9w8":[function(require,module,exports) {
"use strict";function r(r,o,t,n,a,e,f){try{var u=r[e](f),l=u.value}catch(i){return void t(i)}u.done?o(l):Promise.resolve(l).then(n,a)}function o(o){return function(){var t=this,n=arguments;return new Promise(function(a,e){var f=o.apply(t,n);function u(o){r(f,a,e,u,l,"next",o)}function l(o){r(f,a,e,u,l,"throw",o)}u(void 0)})}}function t(r,o,t,n,a,e){for(var f=t*n,u=n,l=a,i=n*a,c=t*a,h=new Float32Array(1*c),m=0;m<1;m++)for(var s=0;s<t;s+=e)for(var p=0;p<a;p+=e)for(var M=0;M<n;M+=e)for(var v=Math.min(s+e,t),w=Math.min(p+e,a),d=Math.min(M+e,n),y=s;y<v;y++)for(var x=p;x<w;x++){for(var g=0,F=M;F<d;F++)g+=r[m*f+y*u+1*F]*o[F*l+1*x+m*i];h[m*c+(y*a+x)]+=g}return h}function n(r,o){return a.apply(this,arguments)}function a(){return(a=o(regeneratorRuntime.mark(function r(o,n){var a,e,f,u,l,i,c,h,m;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:for(console.log("compute_matmul starts ",o,n),f=n[0],u=n[1],l=n[2],48,i=performance.now(),c=0;c<o;c++)a=new Float32Array(f*u).fill(0).map(function(r){return 3*Math.random()}),e=new Float32Array(u*l).fill(0).map(function(r){return 10*Math.random()-5}),t(a,e,f,u,l,48);return h=performance.now(),m=Math.floor(f/48)*Math.floor(l/48)*Math.floor(u/48)*97*48*48+Math.floor(f/48)*Math.floor(l/48)*(u%48!=0)*(u%48*2+1)*48*48+Math.floor(f/48)*(l%48!=0)*Math.floor(u/48)*97*48*(l%48)+(f%48!=0)*Math.floor(l/48)*Math.floor(u/48)*97*(f%48)*48+(f%48!=0)*(l%48!=0)*Math.floor(u/48)*97*(f%48)*(l%48)+(f%48!=0)*Math.floor(l/48)*(u%48!=0)*(u%48*2+1)*(f%48)*48+Math.floor(f/48)*(l%48!=0)*(u%48!=0)*(u%48*2+1)*48*(l%48)+(f%48!=0)*(l%48!=0)*(u%48!=0)*(u%48*2+1)*(f%48)*(l%48),console.log("compute_matmul done"),r.abrupt("return",{result:{exact:!0,reason:""},nFPOpsJS:m,texe:h-i,bwIn:0,bwOut:0});case 8:case"end":return r.stop()}},r)}))).apply(this,arguments)}module.exports={compute:n};
},{}]},{},["g9w8"], "big_compute")
//# sourceMappingURL=/compute_matmul.js.map