Skip to content

Commit 19964eb

Browse files
committed
fix sytax
1 parent bfb1a59 commit 19964eb

File tree

4 files changed

+113
-1
lines changed

4 files changed

+113
-1
lines changed

.github/workflows/short-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- uses: actions/checkout@v4
4141
- name: Run Simulation
4242
run: echo "skipped SASS-Simulation. Will perform in merge queue"
43-
SASS-Simulation:
43+
mail-test:
4444
runs-on: tgrogers-raid
4545
defaults:
4646
run:

runner.py

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/usr/bin/env python3
2+
from jwt import JWT, jwk_from_pem
3+
import time
4+
import requests
5+
6+
pem = "aalp-self-hosted-runner.2024-06-21.private-key.pem"
7+
client_id = "Iv23lixzRYO8eKFZQCxt"
8+
installation_id = "52081584" # Replace with your actual installation ID
9+
10+
# Open PEM
11+
with open(pem, 'rb') as pem_file:
12+
signing_key = jwk_from_pem(pem_file.read())
13+
14+
payload = {
15+
# Issued at time
16+
'iat': int(time.time()),
17+
# JWT expiration time (in sec, 10 minutes maximum)
18+
'exp': int(time.time()) + 60,
19+
# GitHub App's client ID
20+
'iss': client_id
21+
}
22+
23+
# Create JWT
24+
jwt_instance = JWT()
25+
jwt = jwt_instance.encode(payload, signing_key, alg='RS256')
26+
27+
# Set the URL for the request
28+
url = f"https://api.github.com/app/installations/{installation_id}/access_tokens"
29+
30+
# Set the headers
31+
headers = {
32+
"Accept": "application/vnd.github+json",
33+
"Authorization": f"Bearer {jwt}",
34+
"X-GitHub-Api-Version": "2022-11-28"
35+
}
36+
37+
# Send the POST request
38+
response = requests.post(url, headers=headers)
39+
40+
# Get the "token" field from the response
41+
token = response.json().get("token")
42+
43+
# get token for creating the runners
44+
org = "accel-sim" # Replace with your organization name
45+
46+
# Set the URL for the request
47+
url = f"https://api.github.com/orgs/{org}/actions/runners/registration-token"
48+
49+
# Set the headers
50+
headers = {
51+
"Accept": "application/vnd.github+json",
52+
"Authorization": f"Bearer {token}",
53+
"X-GitHub-Api-Version": "2022-11-28"
54+
}
55+
56+
# Send the POST request
57+
response = requests.post(url, headers=headers)
58+
59+
token = response.json().get("token")
60+
print(token)

test

804 KB
Binary file not shown.

test.cu

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#include <iostream>
2+
#include <cuda_runtime.h>
3+
4+
__global__ void testDependency(int *start, int *results, int n)
5+
{
6+
int index = threadIdx.x + blockIdx.x * blockDim.x;
7+
8+
int dependency_var = 0;
9+
10+
// # pragma unroll
11+
for (int i = index; i < n; ++i)
12+
{
13+
// if (start[i] < n && i == start[i])
14+
// {
15+
dependency_var = start[i];
16+
// }
17+
}
18+
results[index] = dependency_var;
19+
}
20+
21+
int main()
22+
{
23+
unsigned n = 1024*1024;
24+
int results[n];
25+
26+
int *d_results;
27+
cudaMalloc(&d_results, n * sizeof(int));
28+
29+
int *start, *d_start;
30+
cudaMalloc(&d_start, n * sizeof(int));
31+
cudaMallocHost(&start, n * sizeof(int));
32+
33+
for (int i = 0; i < n; ++i)
34+
{
35+
start[i] = i;
36+
}
37+
38+
cudaMemcpy(d_start, start, n * sizeof(unsigned), cudaMemcpyHostToDevice);
39+
40+
testDependency<<<1, 1>>>(d_start, d_results, n);
41+
42+
cudaMemcpy(results, d_results, n * sizeof(int), cudaMemcpyDeviceToHost);
43+
44+
cudaFree(d_results);
45+
46+
for (int i = 0; i < n / 1024; ++i)
47+
{
48+
std::cout << "Result[" << i << "]: " << results[i] << std::endl;
49+
}
50+
51+
return 0;
52+
}

0 commit comments

Comments
 (0)