 
 int main(int argc, char *argv[]) {
 
-    unsigned int N = 1024u;
+    unsigned int threads = 1u;
+    unsigned int N = 32u;
     if (argc > 1) {
-        N = (unsigned int) atoi(argv[1]);
+        threads = (unsigned int) atoi(argv[1]);
     }
-    if (N < 32)
-        N = 32;
+    if (argc > 2) {
+        N = (unsigned int) atoi(argv[2]);
+    }
     srand((unsigned int) time(NULL));
 
     unsigned int size = N * N * sizeof(double);

    cudaMemcpy(d_B, h_B, size, cudaMemcpyHostToDevice);
    cudaMemcpy(d_C, h_C, size, cudaMemcpyHostToDevice);

    dim3 threads(32, 32); // 32*32=1024
    dim3 grid(N / threads.x, N / threads.y);

    PartialMM<<<grid, threads>>>(d_A, d_B, d_C, N);

    cudaDeviceSynchronize();

    cudaMemcpy(h_C, d_C, size, cudaMemcpyDeviceToHost);

    printf("Size\t\t%dx%d\n", N, N);
//    printf("Result:");
//    for (unsigned int k = 0u; k < N * N; ++k) {
//        if (k % N == 0)
//            printf("\n");
//        printf("%f ", h_C[k]);
//    }

    free(h_A);
    free(h_B);

    cudaMalloc((void **) &d_C, size);

    for (unsigned int k = 0u; k < N * N; ++k) {
        h_A[k] = 2.0;//rand();
        h_B[k] = 3.0;//rand();
        h_C[k] = 0.0;
    }

