Skip to content

Instantly share code, notes, and snippets.

View vdivakar's full-sized avatar

Divakar Verma vdivakar

View GitHub Profile
@vdivakar
vdivakar / cuda_print_buffer.cu
Created October 8, 2023 22:53
printing from CUDA kernel
template<typename T>
__global__
void print_buffer(const T* buf, uint num_elements){
for(int i=0; i<num_elements; i++){
printf("%x ", buf[i]); // print hex values
}
printf("\n");
}
template<typename T>
@vdivakar
vdivakar / generate_speech.py
Last active October 8, 2023 22:47
Accessing azure text-to-speech cognitive service API using Python and Rest API
import requests
import time
import os
subscription_key = 'YOUR_SUBSCRIPTION_KEY'
location = "<country>"
input_file = "sentences.txt"
output_folder = "output_mp3"
if not os.path.exists(output_folder):