Skip to content

Instantly share code, notes, and snippets.

View Mohammad-debug's full-sized avatar

Mohammad Anas Mohammad-debug

  • United States
View GitHub Profile
@Mohammad-debug
Mohammad-debug / untitled7.ipynb
Last active March 22, 2022 02:42
Untitled7.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// C++ program for the above approach
#include <bits/stdc++.h>
using namespace std;
// Function to check if all array
// elements can be reduced to at
// most mid by at most K splits
int possible(vector<int> & A, int N,
int mid, int K)
{
@Mohammad-debug
Mohammad-debug / firstmodule.ipynb
Created February 18, 2022 12:11
FirstModule.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <iostream>
#include <math.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include "cuda_runtime.h"
#include <malloc.h>
#include "device_launch_parameters.h"
#include <thrust/host_vector.h>
#include<iostream>
#include<math.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include "cuda_runtime.h"
#include <malloc.h>
#include "device_launch_parameters.h"
#include<iostream>
#include<math.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include "cuda_runtime.h"
#include <malloc.h>
#include "device_launch_parameters.h"
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/sequence.h>
#include <thrust/transform_reduce.h>
#include <thrust/functional.h>
#include <thrust/execution_policy.h>
#include <iostream>
#include <math.h>
// now updating the snap rows only
for(int iz=snap_z1; iz<snap_z2; iz+=snap_dz){
for(int ix=snap_x1; ix<snap_x2; ix+=snap_dx){
temp_grad = (grad[iz][ix+snap_dx] - grad[iz][ix])/snap_dx;
for(int kx=1;kx<snap_dx;kx++){
grad[iz][ix+kx] = grad[iz][ix] + temp_grad*kx;
}
}
}
#include<iostream>
#include<math.h>
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include "cuda_runtime.h"
#include <malloc.h>
#include "device_launch_parameters.h"
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <iostream>
#include "cuda_runtime.h"
#include <malloc.h>
#include "device_launch_parameters.h"
#include <math.h>