Untitled

 avatar
unknown
matlab
2 years ago
300 B
7
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);
end
Editor is loading...