Untitled
unknown
matlab
2 years ago
300 B
10
Indexable
% multiplyMatrices.m
function result = multiplyMatrices(A, B)
% Ensure A and B are on GPU
A_gpu = gpuArray(A);
B_gpu = gpuArray(B);
% Multiply matrices on GPU
result_gpu = A_gpu * B_gpu;
% Gather the result back to CPU
result = gather(result_gpu);
endEditor is loading...